Changes in kernel/arch/arm32/src/machine_func.c [ecf083dd:a71c158] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/machine_func.c
recf083dd ra71c158 39 39 40 40 #include <arch/machine_func.h> 41 #include <arch/mach/gta02/gta02.h>42 #include <arch/mach/integratorcp/integratorcp.h>43 #include <arch/mach/testarm/testarm.h>44 41 45 /** Pointer to machine_ops structure being used. */46 struct arm_machine_ops *machine_ops;47 48 /** Initialize machine_ops pointer. */49 void machine_ops_init(void)50 {51 #if defined(MACHINE_gta02)52 machine_ops = >a02_machine_ops;53 #elif defined(MACHINE_testarm)54 machine_ops = &gxemul_machine_ops;55 #elif defined(MACHINE_integratorcp)56 machine_ops = &icp_machine_ops;57 #else58 #error Machine type not defined.59 #endif60 }61 42 62 43 /** Maps HW devices to the kernel address space using #hw_map. */ 63 44 void machine_init(void) 64 45 { 65 (machine_ops ->machine_init)();46 (machine_ops.machine_init)(); 66 47 } 67 48 … … 70 51 void machine_timer_irq_start(void) 71 52 { 72 (machine_ops ->machine_timer_irq_start)();53 (machine_ops.machine_timer_irq_start)(); 73 54 } 74 55 … … 77 58 void machine_cpu_halt(void) 78 59 { 79 (machine_ops ->machine_cpu_halt)();60 (machine_ops.machine_cpu_halt)(); 80 61 } 81 62 82 /** Get extents of available memory. 63 64 /** Returns size of available memory. 83 65 * 84 * @param start Place to store memory start address. 85 * @param size Place to store memory size. 66 * @return Size of available memory. 86 67 */ 87 void machine_get_memory_extents(uintptr_t *start, uintptr_t *size)68 uintptr_t machine_get_memory_size(void) 88 69 { 89 (machine_ops->machine_get_memory_extents)(start, size);70 return (machine_ops.machine_get_memory_size)(); 90 71 } 91 72 … … 95 76 * @param istate Saved processor state. 96 77 */ 97 void machine_irq_exception( unsignedint exc_no, istate_t *istate)78 void machine_irq_exception(int exc_no, istate_t *istate) 98 79 { 99 (machine_ops ->machine_irq_exception)(exc_no, istate);80 (machine_ops.machine_irq_exception)(exc_no, istate); 100 81 } 101 82 … … 106 87 void machine_frame_init(void) 107 88 { 108 (machine_ops ->machine_frame_init)();89 (machine_ops.machine_frame_init)(); 109 90 } 110 91 … … 114 95 void machine_output_init(void) 115 96 { 116 (machine_ops ->machine_output_init)();97 (machine_ops.machine_output_init)(); 117 98 } 118 99 … … 122 103 void machine_input_init(void) 123 104 { 124 (machine_ops ->machine_input_init)();105 (machine_ops.machine_input_init)(); 125 106 } 126 107 127 /** Get IRQ number range used by machine. */ 128 size_t machine_get_irq_count(void) 108 /* 109 * Generic function to use, if sepcific function doesn't define any of the above functions. 110 */ 111 void machine_genfunc() 129 112 { 130 return (machine_ops->machine_get_irq_count)();131 113 } 132 114
Note:
See TracChangeset
for help on using the changeset viewer.