Subversion Repositories HelenOS

Rev

Rev 3607 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3607 Rev 3664
Line 38... Line 38...
38
#include <string.h>
38
#include <string.h>
39
#include <register.h>
39
#include <register.h>
40
#include "main.h"
40
#include "main.h"
41
#include "asm.h"
41
#include "asm.h"
42
 
42
 
-
 
43
/* these tho variables will be set by the detect_subarchitecture function */
43
extern uint8_t subarchitecture;
44
extern uint8_t subarchitecture;
-
 
45
extern uint16_t mid_mask;
44
 
46
 
45
void write(const char *str, const int len)
47
void write(const char *str, const int len)
46
{
48
{
47
    int i;
49
    int i;
48
   
50
   
Line 127... Line 129...
127
    asm volatile ("ldxa [%1] %2, %0\n"
129
    asm volatile ("ldxa [%1] %2, %0\n"
128
        : "=r" (current_mid)
130
        : "=r" (current_mid)
129
        : "r" (0), "i" (ASI_ICBUS_CONFIG));
131
        : "r" (0), "i" (ASI_ICBUS_CONFIG));
130
    current_mid >>= ICBUS_CONFIG_MID_SHIFT;
132
    current_mid >>= ICBUS_CONFIG_MID_SHIFT;
131
 
133
 
132
    if (subarchitecture == SUBARCH_US) {
-
 
133
        current_mid &= ICBUS_CONFIG_MID_MASK_US;
134
    current_mid &= mid_mask;
134
    } else if (subarchitecture == SUBARCH_US3) {
-
 
135
        current_mid &= ICBUS_CONFIG_MID_MASK_US3;
-
 
136
    } else {
-
 
137
        printf("MID format unknown for this subarchitecture.");
-
 
138
        return 0;
-
 
139
    }
-
 
140
 
135
 
141
    /* wake up CPUs */
136
    /* wake up CPUs */
142
   
137
   
143
    cpus_parent = ofw_find_device("/ssm@0,0");
138
    cpus_parent = ofw_find_device("/ssm@0,0");
144
    if (cpus_parent == 0 || cpus_parent == -1) {
139
    if (cpus_parent == 0 || cpus_parent == -1) {