Syllable Internal Functions: Cpu support


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.

Function Documentation

status_t alloc_mtrr_desc ( uint64  nBase,
uint64  nSize,
int  nType 
)

Allocates a mtrr descriptor.

Parameters:
nBase - Base address of the region.
nSize - Size of the region.
nType - Type.
Author:
Arno Klenke ([email protected])

void enable_mmu ( void   ) 

Enables the MMU and reads the MTRR descriptors.

For internal use only.

Author:
Arno Klenke ([email protected])

status_t free_mtrr_desc ( uint64  nBase  ) 

Frees a mtrr descriptor.

Parameters:
nBase - Base address of the mtrr descriptor.
Author:
Arno Klenke ([email protected])

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

Parameters:
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
Author:
Tim ter Laak (timl [At] scintilla [DoT] utwente [DoT] nl)

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();

Parameters:
nProcessorID - The processor id.
Author:
Arno Klenke

void init_cpuid ( void   ) 

Reads the cpuid and enables features like SSE.

Called by init_kernel() (init.c).

For internal use only.

Author:
Arno Klenke ([email protected])

void init_descriptors (  ) 

Initializes the intel descriptors for code and data segments.

For internal use only.

Author:
Arno Klenke ([email protected])

void set_cpu_time_handler ( bigtime_t(*)(int)  pHandler  ) 

Overrides the cpu time handler.

Parameters:
pHandler - Pointer to the handler function. The parameter is the processor id.
Author:
Arno Klenke

void set_idle_loop_handler ( void(*)(int)  pHandler  ) 

Overrides the idle handler.

Parameters:
pHandler - Pointer to the handler function. The parameter is the processor id.
Author:
Arno Klenke

void shutdown_ap_processors ( void   ) 

Shutdown all but the boot processor.

For internal use only.

Author:
Arno Klenke ([email protected])

void shutdown_processor ( void   ) 

Shutdown the current processor.

Needs to be called with disabled interrupts.

For internal use only.

Author:
Arno Klenke ([email protected])

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.

Parameters:
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
Author:
Tim ter Laak (timl [At] scintilla [DoT] utwente [DoT] nl)

void write_mtrr_descs ( void   ) 

Writes the mtrr descriptors into the msr registers.

For internal use only.

Author:
Arno Klenke ([email protected])


Generated on Sat May 9 22:55:14 2009 for Syllable Private Functions by  doxygen 1.5.1