Subversion Repositories HelenOS

Rev

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

Rev 1903 Rev 1978
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2005 Martin Decky
2
 * Copyright (C) 2005 Martin Decky
-
 
3
 * Copyright (C) 2006 Jakub Jermar
3
 * All rights reserved.
4
 * All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * are met:
Line 35... Line 36...
35
#include <ofw.h>
36
#include <ofw.h>
36
#include <printf.h>
37
#include <printf.h>
37
#include <string.h>
38
#include <string.h>
38
#include <register.h>
39
#include <register.h>
39
#include "main.h"
40
#include "main.h"
-
 
41
#include "asm.h"
40
 
42
 
41
void write(const char *str, const int len)
43
void write(const char *str, const int len)
42
{
44
{
43
    int i;
45
    int i;
44
   
46
   
Line 83... Line 85...
83
                   
85
                   
84
                if (current_mid != mid) {
86
                if (current_mid != mid) {
85
                    /*
87
                    /*
86
                     * Start secondary processor.
88
                     * Start secondary processor.
87
                     */
89
                     */
88
                    (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0);
90
                    (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node,
-
 
91
                         KERNEL_VIRTUAL_ADDRESS,
-
 
92
                         bootinfo.physmem_start | AP_PROCESSOR);
89
                }
93
                }
90
            }
94
            }
91
        }
95
        }
92
    }
96
    }
93
 
97
 
94
    return cpus;
98
    return cpus;
95
}
99
}
-
 
100
 
-
 
101
/** Get physical memory starting address.
-
 
102
 *
-
 
103
 * @param start Pointer to variable where the physical memory starting
-
 
104
 *      address will be stored.
-
 
105
 *
-
 
106
 * @return Non-zero on succes, zero on failure.
-
 
107
 */
-
 
108
int ofw_get_physmem_start(uintptr_t *start)
-
 
109
{
-
 
110
    uint32_t memreg[4];
-
 
111
 
-
 
112
    if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0)
-
 
113
        return 0;
-
 
114
 
-
 
115
    *start = (((uint64_t) memreg[0]) << 32) | memreg[1];
-
 
116
    return 1;
-
 
117
}
-
 
118