Date: Thu, 17 May 2012 10:25:35 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r235539 - in stable/9: include sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys Message-ID: <201205171025.q4HAPZZX090860@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu May 17 10:25:34 2012 New Revision: 235539 URL: http://svn.freebsd.org/changeset/base/235539 Log: MFC r234785: Add a convenience macro for the returns_twice attribute, and apply it to the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). Modified: stable/9/include/setjmp.h stable/9/include/unistd.h stable/9/sys/amd64/include/pcb.h stable/9/sys/arm/include/pcb.h stable/9/sys/i386/include/pcb.h stable/9/sys/ia64/include/pcb.h stable/9/sys/mips/include/pcb.h stable/9/sys/powerpc/include/cpu.h stable/9/sys/sparc64/include/pcb.h stable/9/sys/sys/cdefs.h stable/9/sys/sys/systm.h stable/9/sys/sys/ucontext.h Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/include/setjmp.h ============================================================================== --- stable/9/include/setjmp.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/include/setjmp.h Thu May 17 10:25:34 2012 (r235539) @@ -46,16 +46,16 @@ __BEGIN_DECLS #if __BSD_VISIBLE || __XSI_VISIBLE >= 600 void _longjmp(jmp_buf, int) __dead2; -int _setjmp(jmp_buf); +int _setjmp(jmp_buf) __returns_twice; #endif void longjmp(jmp_buf, int) __dead2; #if __BSD_VISIBLE void longjmperror(void); #endif -int setjmp(jmp_buf); +int setjmp(jmp_buf) __returns_twice; #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE void siglongjmp(sigjmp_buf, int) __dead2; -int sigsetjmp(sigjmp_buf, int); +int sigsetjmp(sigjmp_buf, int) __returns_twice; #endif __END_DECLS Modified: stable/9/include/unistd.h ============================================================================== --- stable/9/include/unistd.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/include/unistd.h Thu May 17 10:25:34 2012 (r235539) @@ -479,7 +479,7 @@ char *getwd(char *); /* obsoleted by g useconds_t ualarm(useconds_t, useconds_t); int usleep(useconds_t); -pid_t vfork(void); +pid_t vfork(void) __returns_twice; #endif #if __BSD_VISIBLE Modified: stable/9/sys/amd64/include/pcb.h ============================================================================== --- stable/9/sys/amd64/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/amd64/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -130,7 +130,7 @@ clear_pcb_flags(struct pcb *pcb, const u } void makectx(struct trapframe *, struct pcb *); -int savectx(struct pcb *); +int savectx(struct pcb *) __returns_twice; #endif Modified: stable/9/sys/arm/include/pcb.h ============================================================================== --- stable/9/sys/arm/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/arm/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -94,7 +94,7 @@ void makectx(struct trapframe *tf, struc #ifdef _KERNEL -void savectx(struct pcb *); +void savectx(struct pcb *) __returns_twice; #endif /* _KERNEL */ #endif /* !_MACHINE_PCB_H_ */ Modified: stable/9/sys/i386/include/pcb.h ============================================================================== --- stable/9/sys/i386/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/i386/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -84,7 +84,7 @@ struct pcb { struct trapframe; void makectx(struct trapframe *, struct pcb *); -void savectx(struct pcb *); +void savectx(struct pcb *) __returns_twice; #endif #endif /* _I386_PCB_H_ */ Modified: stable/9/sys/ia64/include/pcb.h ============================================================================== --- stable/9/sys/ia64/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/ia64/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -65,10 +65,10 @@ struct trapframe; void makectx(struct trapframe *, struct pcb *); void restorectx(struct pcb *) __dead2; -int swapctx(struct pcb *old, struct pcb *new); +int swapctx(struct pcb *old, struct pcb *new) __returns_twice; void ia32_restorectx(struct pcb *); -void ia32_savectx(struct pcb *); +void ia32_savectx(struct pcb *) __returns_twice; #endif Modified: stable/9/sys/mips/include/pcb.h ============================================================================== --- stable/9/sys/mips/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/mips/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -78,7 +78,7 @@ struct pcb extern struct pcb *curpcb; /* the current running pcb */ void makectx(struct trapframe *, struct pcb *); -int savectx(struct pcb *); +int savectx(struct pcb *) __returns_twice; #endif #endif /* !_MACHINE_PCB_H_ */ Modified: stable/9/sys/powerpc/include/cpu.h ============================================================================== --- stable/9/sys/powerpc/include/cpu.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/powerpc/include/cpu.h Thu May 17 10:25:34 2012 (r235539) @@ -99,6 +99,6 @@ void fork_trampoline(void); void swi_vm(void *); /* XXX the following should not be here. */ -void savectx(struct pcb *); +void savectx(struct pcb *) __returns_twice; #endif /* _MACHINE_CPU_H_ */ Modified: stable/9/sys/sparc64/include/pcb.h ============================================================================== --- stable/9/sys/sparc64/include/pcb.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/sparc64/include/pcb.h Thu May 17 10:25:34 2012 (r235539) @@ -55,7 +55,7 @@ struct pcb { #ifdef _KERNEL void makectx(struct trapframe *tf, struct pcb *pcb); -int savectx(struct pcb *pcb); +int savectx(struct pcb *pcb) __returns_twice; #endif #endif /* !LOCORE */ Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/sys/cdefs.h Thu May 17 10:25:34 2012 (r235539) @@ -292,6 +292,12 @@ #define __nonnull(x) #endif +#if __GNUC_PREREQ__(4, 1) +#define __returns_twice __attribute__((__returns_twice__)) +#else +#define __returns_twice +#endif + /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) #define __func__ NULL Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/sys/systm.h Thu May 17 10:25:34 2012 (r235539) @@ -155,7 +155,7 @@ struct uio; struct _jmp_buf; struct trapframe; -int setjmp(struct _jmp_buf *); +int setjmp(struct _jmp_buf *) __returns_twice; void longjmp(struct _jmp_buf *, int) __dead2; int dumpstatus(vm_offset_t addr, off_t count); int nullop(void); Modified: stable/9/sys/sys/ucontext.h ============================================================================== --- stable/9/sys/sys/ucontext.h Thu May 17 10:19:49 2012 (r235538) +++ stable/9/sys/sys/ucontext.h Thu May 17 10:25:34 2012 (r235539) @@ -71,7 +71,7 @@ struct ucontext4 { __BEGIN_DECLS -int getcontext(ucontext_t *); +int getcontext(ucontext_t *) __returns_twice; ucontext_t *getcontextx(void); int setcontext(const ucontext_t *); void makecontext(ucontext_t *, void (*)(void), int, ...);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205171025.q4HAPZZX090860>