delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/12/13:00:28

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10303121800.AA20040@clio.rice.edu>
Subject: Re: Getting CRx registers
To: djgpp-workers AT delorie DOT com
Date: Wed, 12 Mar 2003 12:00:15 -0600 (CST)
In-Reply-To: <09e801c2e8ac$6685f830$0600000a@broadpark.no> from "Gisle Vanem" at Mar 12, 2003 04:31:06 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Is there a safe way to get the value of the Control Registers
> (CR0-4) under CPL > 0?. 

Not today.  If there were a good reason I would consider adding something
to CWSDPMI to emulate it - but given the large number of DPMI providers
out there, I think this is a bad idea.

If you need these, why not just run under ring 0?

> Under Win-XP "movl %cr4,%eax" seems to be safe (i.e. doesn't crash), 
> but return value is always 0. 

So it's useless.

> Under plain DOS and CWSDMI it crashes.
> I could probably use a SIGILL handler, but try to avoid it.

If it never returns useful information under CPL > 0, don't do it?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019