summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--os/ip/ipmux.c2
-rw-r--r--os/pc/fpi387.c17
-rw-r--r--os/pc/sd53c8xx.c2
-rw-r--r--os/port/devftl.c4
-rwxr-xr-xos/port/devlogfs.c5
5 files changed, 9 insertions, 21 deletions
diff --git a/os/ip/ipmux.c b/os/ip/ipmux.c
index ef67b0fa..d7187f72 100644
--- a/os/ip/ipmux.c
+++ b/os/ip/ipmux.c
@@ -8,8 +8,6 @@
#include "ip.h"
#define DPRINT if(0)print
-#define offsetof(s, m) (ulong)(&(((s*)0)->m))
-
typedef struct Ipmuxrock Ipmuxrock;
typedef struct Ipmux Ipmux;
typedef struct Ip4hdr Ip4hdr;
diff --git a/os/pc/fpi387.c b/os/pc/fpi387.c
index d516bcf5..76677549 100644
--- a/os/pc/fpi387.c
+++ b/os/pc/fpi387.c
@@ -547,17 +547,16 @@ fstore(Ureg*, int op, void *mem, Internal *s, Internal*)
}
#define REG(x) (*(ulong*)(((char*)ur)+roff[(x)]))
-#define offsetof(X) ((ulong)&((Ureg*)0)->X)
static int roff[] = {
- offsetof(ax),
- offsetof(cx),
- offsetof(dx),
- offsetof(bx),
- offsetof(ecode), /* ksp */
- offsetof(bp),
- offsetof(si),
- offsetof(di),
+ offsetof(Ureg, ax),
+ offsetof(Ureg, cx),
+ offsetof(Ureg, dx),
+ offsetof(Ureg, bx),
+ offsetof(Ureg, ecode), /* ksp */
+ offsetof(Ureg, bp),
+ offsetof(Ureg, si),
+ offsetof(Ureg, di),
};
static long
diff --git a/os/pc/sd53c8xx.c b/os/pc/sd53c8xx.c
index 88a679c8..2d1329af 100644
--- a/os/pc/sd53c8xx.c
+++ b/os/pc/sd53c8xx.c
@@ -1879,8 +1879,6 @@ static Variant variant[] = {
{ SYM_1011_DID, 0xff, "SYM53C1010", Burst128, 16, 64, Prefetch|LocalRAM|BigFifo|Wide|Ultra|Ultra2 },
};
-#define offsetof(s, t) ((ulong)&((s *)0)->t)
-
static int
xfunc(Controller *c, enum na_external x, unsigned long *v)
{
diff --git a/os/port/devftl.c b/os/port/devftl.c
index ab24588a..c0ea2816 100644
--- a/os/port/devftl.c
+++ b/os/port/devftl.c
@@ -32,10 +32,6 @@
#include "kernel.h"
-#ifndef offsetof
-#define offsetof(s, m) (ulong)(&(((s*)0)->m))
-#endif
-
typedef struct Ftl Ftl;
typedef struct Merase Merase;
typedef struct Terase Terase;
diff --git a/os/port/devlogfs.c b/os/port/devlogfs.c
index 630d3eba..9f892e1a 100755
--- a/os/port/devlogfs.c
+++ b/os/port/devlogfs.c
@@ -2,6 +2,7 @@
#include "u.h"
#include "../port/lib.h"
#include "../port/error.h"
+#include "mem.h"
#else
#include "error.h"
#endif
@@ -16,10 +17,6 @@
#define Wakeup wakeup
#endif
-#ifndef offsetof
-#define offsetof(T,X) ((ulong)&(((T*)0)->X))
-#endif
-
typedef struct Devlogfs Devlogfs;
typedef struct DevlogfsSession DevlogfsSession;