Subversion Repositories HelenOS

Rev

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

Rev 1879 Rev 1881
Line 40... Line 40...
40
#include <arch/drivers/tick.h>
40
#include <arch/drivers/tick.h>
41
#include <proc/thread.h>
41
#include <proc/thread.h>
42
#include <console/console.h>
42
#include <console/console.h>
43
#include <arch/boot/boot.h>
43
#include <arch/boot/boot.h>
44
#include <arch/arch.h>
44
#include <arch/arch.h>
-
 
45
#include <arch/asm.h>
45
#include <arch/mm/page.h>
46
#include <arch/mm/page.h>
46
#include <arch/stack.h>
47
#include <arch/stack.h>
47
#include <userspace.h>
48
#include <userspace.h>
48
 
49
 
49
bootinfo_t bootinfo;
50
bootinfo_t bootinfo;
Line 87... Line 88...
87
    if (!t)
88
    if (!t)
88
        panic("cannot create kkbdpoll\n");
89
        panic("cannot create kkbdpoll\n");
89
    thread_ready(t);
90
    thread_ready(t);
90
}
91
}
91
 
92
 
-
 
93
/** Calibrate delay loop.
-
 
94
 *
-
 
95
 * On sparc64, we implement delay() by waiting for the TICK register to
-
 
96
 * reach a pre-computed value, as opposed to performing some pre-computed
-
 
97
 * amount of instructions of known duration. We set the delay_loop_const
-
 
98
 * to 1 in order to neutralize the multiplication done by delay().
-
 
99
 */
92
void calibrate_delay_loop(void)
100
void calibrate_delay_loop(void)
93
{
101
{
-
 
102
    CPU->delay_loop_const = 1;
-
 
103
}
-
 
104
 
-
 
105
/** Wait several microseconds.
-
 
106
 *
-
 
107
 * We assume that interrupts are already disabled.
-
 
108
 *
-
 
109
 * @param t Microseconds to wait.
-
 
110
 */
-
 
111
void asm_delay_loop(const uint32_t usec)
-
 
112
{
-
 
113
    uint64_t stop = tick_read() + (uint64_t) usec * (uint64_t) CPU->arch.clock_frequency / 1000000;
-
 
114
 
-
 
115
    while (tick_read() < stop)
-
 
116
        ;
94
}
117
}
95
 
118
 
96
/** Switch to userspace. */
119
/** Switch to userspace. */
97
void userspace(uspace_arg_t *kernel_uarg)
120
void userspace(uspace_arg_t *kernel_uarg)
98
{
121
{