diff options
author | marcel <marcel@FreeBSD.org> | 2000-01-03 16:49:39 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-01-03 16:49:39 +0000 |
commit | 80b06aacc83c45bff8c5ca824151b055c0921e4f (patch) | |
tree | b4e2fc0e343e715dc81f1ddf16b94b8ec91b1370 | |
parent | 09fefd34d072f58ed7de6248a9b918887a198667 (diff) | |
download | FreeBSD-src-80b06aacc83c45bff8c5ca824151b055c0921e4f.zip FreeBSD-src-80b06aacc83c45bff8c5ca824151b055c0921e4f.tar.gz |
Make offsetof equivalent with <stddef.h>. This paves the way for
further enhancements/reorganisations.
Discussed with: bde
-rw-r--r-- | sys/alpha/linux/linux_genassym.c | 8 | ||||
-rw-r--r-- | sys/i386/linux/linux_genassym.c | 8 | ||||
-rw-r--r-- | sys/i386/svr4/svr4_genassym.c | 13 | ||||
-rw-r--r-- | sys/sys/assym.h | 2 |
4 files changed, 17 insertions, 14 deletions
diff --git a/sys/alpha/linux/linux_genassym.c b/sys/alpha/linux/linux_genassym.c index b555486..b9a31ef 100644 --- a/sys/alpha/linux/linux_genassym.c +++ b/sys/alpha/linux/linux_genassym.c @@ -5,7 +5,7 @@ #include <i386/linux/linux.h> -ASSYM(LINUX_SIGF_HANDLER, offsetof(linux_sigframe, sf_handler)); -ASSYM(LINUX_SIGF_SC, offsetof(linux_sigframe, sf_sc)); -ASSYM(LINUX_SC_GS, offsetof(linux_sigcontext, sc_gs)); -ASSYM(LINUX_SC_EFLAGS, offsetof(linux_sigcontext, sc_eflags)); +ASSYM(LINUX_SIGF_HANDLER, offsetof(struct linux_sigframe, sf_handler)); +ASSYM(LINUX_SIGF_SC, offsetof(struct linux_sigframe, sf_sc)); +ASSYM(LINUX_SC_GS, offsetof(struct linux_sigcontext, sc_gs)); +ASSYM(LINUX_SC_EFLAGS, offsetof(struct linux_sigcontext, sc_eflags)); diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c index b555486..b9a31ef 100644 --- a/sys/i386/linux/linux_genassym.c +++ b/sys/i386/linux/linux_genassym.c @@ -5,7 +5,7 @@ #include <i386/linux/linux.h> -ASSYM(LINUX_SIGF_HANDLER, offsetof(linux_sigframe, sf_handler)); -ASSYM(LINUX_SIGF_SC, offsetof(linux_sigframe, sf_sc)); -ASSYM(LINUX_SC_GS, offsetof(linux_sigcontext, sc_gs)); -ASSYM(LINUX_SC_EFLAGS, offsetof(linux_sigcontext, sc_eflags)); +ASSYM(LINUX_SIGF_HANDLER, offsetof(struct linux_sigframe, sf_handler)); +ASSYM(LINUX_SIGF_SC, offsetof(struct linux_sigframe, sf_sc)); +ASSYM(LINUX_SC_GS, offsetof(struct linux_sigcontext, sc_gs)); +ASSYM(LINUX_SC_EFLAGS, offsetof(struct linux_sigcontext, sc_eflags)); diff --git a/sys/i386/svr4/svr4_genassym.c b/sys/i386/svr4/svr4_genassym.c index 7f2c3b6..f55b5ed 100644 --- a/sys/i386/svr4/svr4_genassym.c +++ b/sys/i386/svr4/svr4_genassym.c @@ -15,8 +15,11 @@ struct proc; #define SVR4_MACHDEP_JUST_REGS #include <i386/svr4/svr4_machdep.h> -ASSYM(SVR4_SIGF_HANDLER, offsetof(svr4_sigframe, sf_handler)); -ASSYM(SVR4_SIGF_UC, offsetof(svr4_sigframe, sf_uc)); -ASSYM(SVR4_UC_FS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])); -ASSYM(SVR4_UC_GS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])); -ASSYM(SVR4_UC_EFLAGS, offsetof(svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])); +ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler)); +ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc)); +ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext, + uc_mcontext.greg[SVR4_X86_FS])); +ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext, + uc_mcontext.greg[SVR4_X86_GS])); +ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext, + uc_mcontext.greg[SVR4_X86_EFL])); diff --git a/sys/sys/assym.h b/sys/sys/assym.h index 230d1f5..4350316 100644 --- a/sys/sys/assym.h +++ b/sys/sys/assym.h @@ -32,7 +32,7 @@ #define _SYS_ASSYM_H_ #ifndef offsetof -#define offsetof(s, m) (&((struct s*)0)->m) +#define offsetof(t, m) (&((t *)0)->m) #endif #ifndef __assym |