Messages in this thread | | | From | Olaf Titz <> | Subject | Re: >256 fd patch... | Date | 25 Mar 1997 17:03:16 +0100 |
| |
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 << ____
| |