1 /* 2 ** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 ** Distributed under the terms of the Haiku License. 4 */ 5 #ifndef _KERNEL_ARCH_M68K_CPU_H 6 #define _KERNEL_ARCH_M68K_CPU_H 7 8 #ifndef _ASSEMBLER 9 10 #include <arch/arm/arch_thread_types.h> 11 #include <kernel.h> 12 13 #endif // !_ASSEMBLER 14 15 16 17 #ifndef _ASSEMBLER 18 19 /* raw exception frames */ 20 21 22 23 #warning ARM: check for missing regs/movem 24 struct iframe { 25 uint32 r0; 26 uint32 r1; 27 uint32 r2; 28 uint32 r3; 29 uint32 r4; 30 uint32 r5; 31 uint32 r6; 32 uint32 r7; 33 uint32 r8; 34 uint32 r9; 35 uint32 r10; 36 uint32 r11; 37 uint32 r12; 38 uint32 r13; 39 uint32 lr; 40 uint32 pc; 41 uint32 cpsr; 42 } _PACKED; 43 44 45 typedef struct arch_cpu_info { 46 int null; 47 } arch_cpu_info; 48 49 50 #ifdef __cplusplus 51 extern "C" { 52 #endif 53 54 55 //extern void sethid0(unsigned int val); 56 //extern unsigned int getl2cr(void); 57 //extern void setl2cr(unsigned int val); 58 extern long long get_time_base(void); 59 60 //void __m68k_setup_system_time(vint32 *cvFactor); 61 // defined in libroot: os/arch/system_time.c 62 //int64 __m68k_get_time_base(void); 63 // defined in libroot: os/arch/system_time_asm.S 64 65 extern void arm_context_switch(void **_oldStackPointer, void *newStackPointer); 66 67 extern bool arm_set_fault_handler(addr_t *handlerLocation, addr_t handler) 68 __attribute__((noinline)); 69 70 //extern bool m68k_is_hw_register_readable(addr_t address); 71 //extern bool m68k_is_hw_register_writable(addr_t address, uint16 value); 72 // defined in kernel: arch/m68k/cpu_asm.S 73 74 #ifdef __cplusplus 75 } 76 #endif 77 78 struct arm_cpu_ops { 79 void (*flush_insn_pipeline)(void); 80 void (*flush_atc_all)(void); 81 void (*flush_atc_user)(void); 82 void (*flush_atc_addr)(addr_t addr); 83 void (*flush_dcache)(addr_t address, size_t len); 84 void (*flush_icache)(addr_t address, size_t len); 85 void (*idle)(void); 86 }; 87 #warning ARM:check cpu_ops 88 extern struct arm_cpu_ops cpu_ops; 89 90 //#define 91 92 93 extern int arch_cpu_type; 94 extern int arch_fpu_type; 95 extern int arch_mmu_type; 96 extern int arch_platform; 97 extern int arch_machine; 98 99 #endif // !_ASSEMBLER 100 101 #endif /* _KERNEL_ARCH_ARM_CPU_H */ 102