2 * Copyright 2003, Travis Geiselbrecht. All rights reserved.
3 * Distributed under the terms of the NewOS License.
7 #include <arch/m68k/arch_cpu.h>
13 // ToDo: fixme -- platform dependant ?
20 /* void arch_int_enable_interrupts(void) */
21 FUNCTION(arch_int_enable_interrupts):
24 FUNCTION_END(arch_int_enable_interrupts)
27 /* int arch_int_disable_interrupts(void)
29 FUNCTION(arch_int_disable_interrupts):
35 // return value: previous IPM
39 FUNCTION_END(arch_int_disable_interrupts)
42 /* void arch_int_restore_interrupts(int oldState)
44 FUNCTION(arch_int_restore_interrupts):
46 // make sure we only have IPM bits
54 FUNCTION_END(arch_int_restore_interrupts)
57 /* bool arch_int_are_interrupts_enabled(void) */
58 FUNCTION(arch_int_are_interrupts_enabled):
62 bne arch_int_are_interrupts_enabled_no
64 arch_int_are_interrupts_enabled_no:
66 FUNCTION_END(arch_int_are_interrupts_enabled)
70 FUNCTION(dbg_save_registers):
71 #warning M68K: implement dbx_save_registers!
73 FUNCTION_END(dbg_save_registers)
76 /* long long get_time_base(void) */
77 FUNCTION(get_time_base):
78 #warning M68K: implement get_time_base!
81 //passed through a0 or d0:d1 ?
83 FUNCTION_END(get_time_base)
86 #warning M68K: FIX m68k_context_switch
87 // XXX:sync with arch_thread.c:arch_thread_init_kthread_stack
88 // void m68k_context_switch(addr_t *old_sp, addr_t new_sp);
89 FUNCTION(m68k_context_switch):
92 movem.l %d0-%d7/%a0-%a7,-(%sp)
93 fmovem %fp0-%fp7,-(%sp)
95 #warning M68K: use fixed size for fsave
100 fmovem (%sp)+,%fp0-%fp7
101 movem.l (%sp)+,%d0-%d7/%a0-%a7
105 FUNCTION_END(m68k_context_switch)
108 // m68k_kernel_thread_root(): parameters in r13-r15, the functions to call
109 // (in that order). The function is used when spawing threads. It usually calls
110 // an initialization function, the actual thread function, and a function that
111 // destroys the thread.
112 FUNCTION(m68k_kernel_thread_root):
121 // We should never get here. If we do, it's time to enter the kernel
122 // debugger (without a message at the moment).
125 FUNCTION_END(m68k_kernel_thread_root)