Changeset 296 for trunk/hal/generic
- Timestamp:
- Jul 31, 2017, 1:59:52 PM (7 years ago)
- Location:
- trunk/hal/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r151 r296 32 32 // void* pointers stored in the thread descriptor. 33 33 // - the "hal_context_t" structure is used to store the CPU registers values that 34 // have not been saved in the stack by the interrupt handler.34 // have not been saved in the kernel stack by the interrupt handler. 35 35 // - the "hal_fpu_context_t" structure is used to save the FPU registers when required. 36 36 ////////////////////////////////////////////////////////////////////////////////////////// … … 43 43 * This function allocates, from the local cluster, the physical memory required for 44 44 * the thread CPU context, initialises it, and links the context to the thread. 45 * Seven registers are initialised:46 * - sp_29 / fp_30 / ra_3147 * - c0_sr / c0_th48 * - c2_ptpr / c2_mode49 45 **************************************************************************************** 50 46 * @ thread : pointer on the thread descriptor. … … 73 69 74 70 /**************************************************************************************** 75 * This function saves in the thread context the CPU registers values that have not 76 * been saved in the thread stack by the exception handler: 77 * - GRs : s0 to S7 , sp , fp, ra 78 * - CP0 : th 79 * - CP2 : ptpr , mode 71 * This function saves in the thread context the CPU registers values that must be 72 * saved at context switch. 80 73 **************************************************************************************** 81 * @ thread : pointer on the thread descriptor.74 * @ ctx : pointer on cpu context. 82 75 ***************************************************************************************/ 83 void hal_cpu_context_save( struct thread_s * thread);76 void hal_cpu_context_save( void * ctx ); 84 77 85 78 /**************************************************************************************** 86 * This function restores from the thread context the CPU registers values that have not 87 * been saved in the thread stack by the exception handler. 88 * - GRs : s0 to S7 , sp , fp, ra 89 * - CP0 : th 90 * - CP2 : ptpr , mode 79 * This function restores from the thread context the CPU registers values that must 80 * be restored at context switch. 91 81 **************************************************************************************** 92 * @ thread : pointer on the thread descriptor.82 * @ ctx : pointer on cpu context. 93 83 ***************************************************************************************/ 94 void hal_cpu_context_restore( struct thread_s * thread);84 void hal_cpu_context_restore( void * ctx ); 95 85 96 86 /**************************************************************************************** 97 87 * This function loads the relevant CPU registers from values contained in 98 88 * the thread context. It should be called for a thread that has not been executed yet. 99 * - GRs : sp , fp , a0100 * - CP0 : sr , epc , th101 * - CP2 : ptpr , mode102 89 * It reset the loadable flag in thread descriptor. 103 90 **************************************************************************************** … … 105 92 ***************************************************************************************/ 106 93 void hal_cpu_context_load( struct thread_s * thread ); 107 108 94 109 95 -
trunk/hal/generic/hal_ppm.h
r64 r296 54 54 error_t hal_ppm_init( boot_info_t * info ); 55 55 56 /**************************************************************************************** 57 * This function initializes the architecture specific core registers, for the 58 * calling core. It is executed by all cores during kernel_init(). 59 **************************************************************************************** 60 * @ info : pointer on the boot_info structure. 61 ***************************************************************************************/ 62 void hal_core_init( boot_info_t * info ); 63 64 65 56 66 #endif /* HAL_PPM_H_ */ -
trunk/hal/generic/hal_special.h
r279 r296 34 34 // Generic Special Registers Access API (implementation in hal_special.c) 35 35 // 36 // ALMOS-MKH uses the following API to access the MMU and othercore protected registers.36 // ALMOS-MKH uses the following API to access the core protected registers. 37 37 /////////////////////////////////////////////////////////////////////////////////////////// 38 38 … … 50 50 * This function returns the current value of the hardware cycles counter. 51 51 ****************************************************************************************/ 52 inline cycle_t hal_time_stamp();52 inline reg_t hal_time_stamp(); 53 53 54 54 /***************************************************************************************** 55 * This function returns the content of the calling core private cycles counter. 55 * This function returns the content of the calling core private cycles counter, 56 * taking into account overflow if the core hardware register is not 64 bits. 56 57 * This cycle counter is reset when the core is initialised (at each boot). 57 * If the hardware counter is not a 64 bits register, this function must handle overflow.58 58 ****************************************************************************************/ 59 uint64_t hal_get_cycles();59 cycle_t hal_get_cycles(); 60 60 61 61 /***************************************************************************************** … … 68 68 ****************************************************************************************/ 69 69 void hal_set_current_thread( struct thread_s * thread ); 70 71 /***************************************************************************************** 72 * This function registers a new kentry base address in the relevant core register. 73 ****************************************************************************************/ 74 void hal_set_ebase( reg_t base ); 70 75 71 76 /*****************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.