Functions | |
void | init_cpuid (void) |
Reads the cpuid and enables features like SSE. | |
void | write_mtrr_descs (void) |
Writes the mtrr descriptors into the msr registers. | |
status_t | alloc_mtrr_desc (uint64 nBase, uint64 nSize, int nType) |
Allocates a mtrr descriptor. | |
status_t | free_mtrr_desc (uint64 nBase) |
Frees a mtrr descriptor. | |
void | enable_mmu (void) |
Enables the MMU and reads the MTRR descriptors. | |
void | init_descriptors () |
Initializes the intel descriptors for code and data segments. | |
status_t | get_cpu_extended_info (int nPhysicalCPUId, CPU_Extended_Info_s *_psInfo, int nVersion) |
Get a copy of the Extended CPU Info record for a specified CPU. | |
void | update_cpu_speed (int nPhysicalCPUId, uint64 nCoreSpeed, uint32 nDelayCount) |
Update (set) speed metrics for a specified CPU. | |
void | set_cpu_time_handler (bigtime_t(*pHandler)(int)) |
Overrides the cpu time handler. | |
bigtime_t | get_cpu_time (int nProcessorID) |
Returns the current cpu time. | |
void | shutdown_ap_processors (void) |
Shutdown all but the boot processor. | |
void | shutdown_processor (void) |
Shutdown the current processor. | |
void | set_idle_loop_handler (void(*pHandler)(int)) |
Overrides the idle handler. |
status_t alloc_mtrr_desc | ( | uint64 | nBase, | |
uint64 | nSize, | |||
int | nType | |||
) |
Allocates a mtrr descriptor.
nBase | - Base address of the region. | |
nSize | - Size of the region. | |
nType | - Type. |
void enable_mmu | ( | void | ) |
Enables the MMU and reads the MTRR descriptors.
For internal use only.
status_t free_mtrr_desc | ( | uint64 | nBase | ) |
Frees a mtrr descriptor.
nBase | - Base address of the mtrr descriptor. |
status_t get_cpu_extended_info | ( | int | nPhysicalCPUId, | |
CPU_Extended_Info_s * | _psInfo, | |||
int | nVersion | |||
) |
Get a copy of the Extended CPU Info record for a specified CPU.
NOTE: This function currently does *NO* locking, as there is no lock for g_asProcessorDescs. If the processor's info is being updated during copying, the copy may be inconsistent
nPhysicalCPUId | - Physical ID for the CPU to get info for (as returned by get_processor_id() ) | |
psInfo | - pointer to pre-allocated CPU_Extended_Info_s struct, destination of CPU record. | |
nVersion | - Version of the CPU_Extended_Info_s struct to use |
bigtime_t get_cpu_time | ( | int | nProcessorID | ) | [inline] |
Returns the current cpu time.
The functions calls the handler set by the set_cpu_time_handler() function or get_system_time();
nProcessorID | - The processor id. |
void init_cpuid | ( | void | ) |
Reads the cpuid and enables features like SSE.
Called by init_kernel() (init.c).
For internal use only.
void init_descriptors | ( | ) |
Initializes the intel descriptors for code and data segments.
For internal use only.
void set_cpu_time_handler | ( | bigtime_t(*)(int) | pHandler | ) |
Overrides the cpu time handler.
pHandler | - Pointer to the handler function. The parameter is the processor id. |
void set_idle_loop_handler | ( | void(*)(int) | pHandler | ) |
Overrides the idle handler.
pHandler | - Pointer to the handler function. The parameter is the processor id. |
void shutdown_ap_processors | ( | void | ) |
Shutdown all but the boot processor.
For internal use only.
void shutdown_processor | ( | void | ) |
Shutdown the current processor.
Needs to be called with disabled interrupts.
For internal use only.
void update_cpu_speed | ( | int | nPhysicalCPUId, | |
uint64 | nCoreSpeed, | |||
uint32 | nDelayCount | |||
) |
Update (set) speed metrics for a specified CPU.
NOTE: This function currently does *NO* locking, as there is no lock for g_asProcessorDescs. If another thread reads between updating the two fields, its data may be inconsistent for our speed data.
nPhysicalCPUId | - Physical ID for the CPU to get info for (as returned by get_processor_id() ) | |
nCoreSpeed | - New CPU core speed in Hz | |
nDelayCount | - New pi_nDelayCount value, used for busy-looping delays |
void write_mtrr_descs | ( | void | ) |
Writes the mtrr descriptors into the msr registers.
For internal use only.