Home |
RTTarget-32 Programming Manual System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) Function RTMPStartCPU Function RTMPSynchTimeStampCounters |
Function RTMPStartCPURTMPStartCPU starts an additional CPU: UINT RTMPStartCPU(UINT CPU, DWORD Flags, WORD FS, void * ESP, void (__cdecl * Entrypoint)(void * P), void * Parameter); ParametersCPUIndex of the CPU to start. This parameter must be in the range 0 .. RTMPCPUs(...)-1 and it must not be equal to RTMPSelf(). FlagsZero or a combination of the following flag values:
FSSegment selector to be loaded in the target CPU's FS register. If value 0xFFFF is specified, the target CPU will use the FS value of the calling CPU. ESPInitial ESP value for the started CPU. This must be a DWORD aligned address pointing to the first byte beyond the stack allocated for the new CPU. EntrypointC/C++ function the CPU shall execute. This function must never return! ParameterThe parameter to be passed to function Entrypoint on the started CPU. return valueZero on failure and non-zero otherwise. This function requires APIC mode and will call RTMPSetAPICMode(0) if not in APIC mode. Like all x86 CPUs, additional application CPUs start execution in real mode. Thus, the initial startup code must reside in the first megabyte of the physical address space. RTMPStartCPU attempts to allocate space for the startup code by looking for a Nothing section with name "APBootCode". If that fails, it will try function RTAllocPhysPageAligned. If both allocations fail or the returned address is not within the first megabyte, the function fails and displays error message: Failed to allocate AP Boot Code To guard against such failures, it is recommended to include the following directive in the application's locator configuration file: Locate Nothing APBootCode DOSMem 4k 4k ReadWrite where DOSMem may be replaced with any RAM region below 1M. Section APBootCode must have a size of 4k and must be 4k aligned.
|