Home |
RTTarget-32 Programming Manual Function RTHaltCPL3 Function RTSetDLLNameTranslation System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTHaltCPL3RTHaltCPL3 also waits for a hardware interrupt. However, unlike function RTHalt, it can switch to CPL 0 temporarily to execute the CPU HLT instruction: BYTE RTHaltCPL3(void); The function returns the current privilege level (0 or 3). If the program runs at privilege level 0, HLT is executed. Otherwise, RTHaltCPL3 sets up a custom IDT, switches to ring 0 and executes HLT. When a hardware interrupt occurs, the function switches back to ring 3 and re-raises the interrupt to allow the application's handler to process the interrupt. RTHaltCPL3 makes the advantages of the HLT instruction available without sacrificing protection. However, RTHaltCPL3 requires a privilege level transition before an interrupt is actually serviced. For example, on a Pentium 100MHz, using function RTHaltCPL3 would increase the interrupt latency by about 1 - 2 microseconds. RTHaltCPL3 can also be used as an RTTarget-32 idle handler (see function RTWait). To have the Debug Monitor execute RTHaltCPL3 while it is idle, see the configuration file command COMPort.
|