Re: WMMX registers mangled after a context switch



MMX registers are aliases for the x86 FPU registers, and should be automatically context-switched.

Are you trying to use SSE and not MMX?

Barry

"Ross Jordan [MSFT]" <ross.nospam.jordan@xxxxxxxxxxxxx> wrote in message news:45e3611f$1@xxxxxxxxxxxxxxxxxxxxx
If neither kernel nor BSP saves your registers on a context switch, there's not much you can do from usermode to save them. There's really no way for a user app to know when its going to be context switched. Any other threads on the system should be in a similar situation. If you can rebuild your BSP, see if setting the BSP_COPROCSUPPORT=1 flag helps out.

-Ross

"Ilya Konstantinov" <ilya.konstantinov@xxxxxxxxx> wrote in message news:1172483380.733253.185590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ross, thanks for the answer.

Perhaps my post shouldn't have been directed to this newsgroup, since
we're not the OEM but rather an application developer. We're
developing for a (yet-unreleased) device running PXA270, which the OEM
preloads with a valid ROM kernel.

My point was that Windows Media Player on this device somehow manages
to save WMMX registers over context switches. Can WMP, a user-level
application, somehow hook into the kernel to do just that?

Saving the registers is something I've assumed to be the kernel's
responsibility. You've pointed me to a function which the OEM should
implement while linking his kernel. More over, this function is
intended for vendor-specific debug registers, not for something as
standardized as WMMX. Are you sure this is the right track?

On Feb 26, 8:50 am, "Ross Jordan [MSFT]"
<ross.nospam.jor...@xxxxxxxxxxxxx> wrote:
I'm not a BSP expert, but I believe you want to look at
pOEMSaveCoProcRegister / pOEMRestoreCoProcRegister called by scheduler
during context switch and the BSP flag: BSP_COPROCSUPPORT which may turn
this on/off depending on the BSP.
"Ilya Konstantinov" <ilya.konstanti...@xxxxxxxxx> wrote in message news:1172426064.211247.173320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> We've been writing a graphically-intense application for Windows
> Mobile 5, and to speed it up we've been using the WMMX instruction
> set. It indeed gave us quite a performance boost, but soon enough we
> found out that with any concurrent WMMX-using process will step over
> our WMMX registers ... and the context switch back to our program
> won't restore them!


.



Relevant Pages

  • Re: GetThreadContext and debug register problem
    ... If you want to set a breakpoint in a debug ... CONTEXT structure, and then pass it to SetThreadContext. ... memory breakpoints have to be numerically below 0x80000000 - otherwise, ... debug registers via two ways. ...
    (microsoft.public.win32.programmer.kernel)
  • [PATCH 09/21] 2.6.19 perfmon2 : register read-write operations
    ... This patch contains the core read-write operations on the PMU registers ... There is no read operation on PMC because they are always set by the users. ... * The context is locked and interrupts are disabled. ...
    (Linux-Kernel)
  • [PATCH 09/22] 2.6.22-rc3 perfmon2 : register read-write operations
    ... This patch contains the core read-write operations on the PMU registers ... There is no read operation on PMC because they are always set by the users. ... * The context is locked and interrupts are disabled. ...
    (Linux-Kernel)
  • Re: What is a word ?
    ... >>> particular vendors happen to mean in the context of data types. ... Some of the more difficult cases include things like stack machines ... (which may not have any programmable registers at all - and may have ...
    (comp.lang.asm.x86)
  • Re: WMMX registers mangled after a context switch
    ... If neither kernel nor BSP saves your registers on a context switch, there's not much you can do from usermode to save them. ...
    (microsoft.public.windowsce.platbuilder)

Loading