lkml.org 
[lkml]   [1997]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: >256 fd patch...
Date
Michael O'Reilly <michael@metal.iinet.net.au> wrote:
> Problem is, how do I easily stuff the program counter into a variable?

<linux/skbuff.h> has this (see also gcc.info on "Labels as values"):

extern __inline__ unsigned char *skb_put(struct sk_buff *skb, int len)
{
unsigned char *tmp=skb->tail;
skb->tail+=len;
skb->len+=len;
if(skb->tail>skb->end)
{
__label__ here;
panic("skput:over: %p:%d", &&here,len);
here:
}
return tmp;
}
> Also, does anything rely on the flag remaining unchanged over a call
> to cli()?

If you put "cc" in the clobber list, i.e.
__asm__ __volatile__ ("cli": : :"memory", "cc")
nothing should rely on the flag register.

olaf
--
___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____
__ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius>
__/<_ >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____
\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.088 / U:0.272 seconds]
©2003-2011 Jasper Spaans. Advertise on this site