Subversion Repositories HelenOS

Rev

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

Rev 2190 Rev 2329
Line 37... Line 37...
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <arch/stack.h>
39
#include <arch/stack.h>
40
#include <config.h>
40
#include <config.h>
41
 
41
 
-
 
42
 
42
static inline void cpu_sleep(void)
43
static inline void cpu_sleep(void)
43
{
44
{
44
    // not implemented on gxemul
45
    // not implemented on gxemul
45
}
46
}
46
 
47
 
-
 
48
 
47
/** Return base address of current stack
49
/** Return base address of current stack
48
 *
50
 *
49
 * Return the base address of the current stack.
51
 * Return the base address of the current stack.
50
 * The stack is assumed to be STACK_SIZE bytes long.
52
 * The stack is assumed to be STACK_SIZE bytes long.
51
 * The stack must start on page boundary.
53
 * The stack must start on page boundary.
Line 55... Line 57...
55
    uintptr_t v;
57
    uintptr_t v;
56
    asm volatile ("and %0, sp, %1\n" : "=r" (v) : "r" (~(STACK_SIZE-1)));
58
    asm volatile ("and %0, sp, %1\n" : "=r" (v) : "r" (~(STACK_SIZE-1)));
57
    return v;
59
    return v;
58
}
60
}
59
 
61
 
-
 
62
 
60
extern void cpu_halt(void);
63
extern void cpu_halt(void);
61
extern void asm_delay_loop(uint32_t t);
64
extern void asm_delay_loop(uint32_t t);
62
extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg,
65
extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg, uintptr_t entry);
63
    uintptr_t entry);
-
 
64
 
66
 
65
extern ipl_t interrupts_disable(void);
67
extern ipl_t interrupts_disable(void);
66
extern ipl_t interrupts_enable(void);
68
extern ipl_t interrupts_enable(void);
67
extern void interrupts_restore(ipl_t ipl);
69
extern void interrupts_restore(ipl_t ipl);
68
extern ipl_t interrupts_read(void);
70
extern ipl_t interrupts_read(void);