Share via


Implementing Save and Restore Coprocessor Register Support (Windows CE 5.0)

Send Feedback

You can use a single set of variables and functions to save and restore coprocessor registers from a number of coprocessors at the same time. You must coordinate the single set of functions and variables to ensure that the proper state is saved and restored when the coprocessor is active and must have its state saved. The following procedure shows how to save and restore debug registers.

To save and restore debug registers

  1. During OEMInit, set cbNKCoProcRegSize to be the maximum size buffer that will be required to save and restore the state of all coprocessor registers.

  2. Set fNKSaveCoProcReg to 0 until the coprocessor state has been saved.

  3. Set the function pointers to point to OAL functions that will be used to initialize, save, and restore the coprocessor state.

    If you intend to save debug registers, the kernel should call the save and restore functions only when necessary.

  4. In OEMKDIoControl, use the following IOCTLs to set and clear data and code hardware breakpoints.

    When a breakpoint is set, you can increment fNKSaveCoProcReg by one. When a break point is cleared, you can decrement fNKSaveCoProcReg.

  5. In addition to the fNKSaveCoProcReg value, you must track the location of the debug register data in the buffer area.

    You can track the location of the debug register data by defining a structure that is static, but encompasses all the data that will be stored in the buffer.

See Also

Additional Kernel Functionality | OEMSaveCoProcRegister | OEMRestoreCoProcRegister | OEMInitCoProcRegisterSavedArea

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.