delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/20/22:17:38

From: erfarmer201 AT comcast DOT net (Eric Farmer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question re IRET wrapper and rdtsc
Date: 20 Nov 2002 18:34:14 -0800
Organization: http://groups.google.com/
Lines: 34
Message-ID: <a1babb92.0211201834.74e54d61@posting.google.com>
References: <a1babb92 DOT 0211181535 DOT 480d34e2 AT posting DOT google DOT com> <3dd9a65b DOT sandmann AT clio DOT rice DOT edu>
NNTP-Posting-Host: 68.55.233.20
X-Trace: posting.google.com 1037846054 15706 127.0.0.1 (21 Nov 2002 02:34:14 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 21 Nov 2002 02:34:14 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Charles Sandmann <sandmann AT clio DOT rice DOT edu> wrote in message news:<3dd9a65b DOT sandmann AT clio DOT rice DOT edu>...
> > 1.  I am using _go32_dpmi_allocate_iret_wrapper and family to install
> > the handler (see code below).  Does my handler need the commonly-used
> > cli/pusha preamble (and accompanying popa/sti), or does the wrapper
> > code do this for me?  I have been unable to decipher the djgpp source,
> > and there seems to be conflicting advice out there.
> 
> Do not use cli/sti with the wrappers.  If there is any advice which 
> says they should be used, let us know so we can fix it.  pusha/popa
> are not needed; they are done in the wrapper.

Thank you much for the reply.  Here are the first three pages I found
which have the asm("cli;pusha") "idiom" (although all appear to be
independent sites, so it's not djgpp's docs that are the problem.  But
with the proliferation of these examples, I was not able to infer from
the docs that it _wasn't_ necessary):

http://www.geocities.com/SiliconValley/Park/8933/interrupts.html
http://www-scf.usc.edu/~akotaobi/opkey.html
http://www.whisqu.se/per/docs/general25.htm

Any takers on the second question (i.e., is the following the correct
call to rdtsc)?

    unsigned long long tsc;
    asm volatile ("cpuid\n\t"
                  "rdtsc"
                  : "=A" (tsc)
                  :
                  : "bx", "cx");


Thanks again,
Eric Farmer

- Raw text -


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