Compartilhar via


OEMMpStartAllCPUs (Compact 2013)

3/28/2014

This function runs on the master CPU and starts all subordinate CPUs in a multiprocessor platform.

Syntax

BOOL OEMMpStartAllCPUs(
    PLONG pnCpus,
   FARPROC pfnContinue
);

Parameters

  • pnCpus
    Pointer to the number of non-master processors in the system.
  • pfnContinue
    Pointer to the kernel-supplied function that initializes the CPU.

Return Value

Returns true if more than one processor is present in the system; otherwise, false.

Remarks

To support multiple processors, you must implement this function. If you implement OEMMpStartAllCPUs, set the pfnStartAllCpus member of OEMGLOBAL to point to this function.

This function is the first call to the OEM adaptation layer (OAL) for symmetric multiprocessing (SMP) running on the main processor at the highest level of privilege. The OAL starts all the secondary processors when the kernel calls the StartAllCpus function.

When secondary processors start running, they perform the minimum necessary initialization to set up a memory management unit (MMU) and then jump to the address contained in pfnContinue.

Upon return from the StartAllCpus function, an OEM must update pnCpus to the total number of processors in the system.

Because the kernel calls this function after it calls OEMInit, all the control registers are already set up correctly on the main processor. An OEM can use the register settings of the main processor to set up all secondary processors.

Note

A common mistake in the startup code of secondary processors is to use the stack, for example, instructions that call a C function). If you use such instructions, set up a temporary stack for the secondary processors first.

Requirements

Header

oemglobal.h

See Also

Reference

SMP Functions
OEMMpPerCPUInit

Other Resources

Optional OAL Functions