ref: 5484260b42b0a4061444670e812aff3973cc79fb
parent: 3e98132fc613f8bbe0124225adc92a0fec2546e6
author: cinap_lenrek <[email protected]>
date: Mon Oct 11 07:52:37 EDT 2021
kernel: move waserror() macro to port/portfns.h
--- a/sys/src/9/bcm/fns.h
+++ b/sys/src/9/bcm/fns.h
@@ -133,8 +133,6 @@
#define kmapinval()
#define countpagerefs(a, b)
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
#define KADDR(pa) ((void*)(KZERO | ((uintptr)(pa) & ~KSEGM)))
#define PADDR(va) (PHYSDRAM | ((uintptr)(va) & ~KSEGM))
--- a/sys/src/9/bcm64/fns.h
+++ b/sys/src/9/bcm64/fns.h
@@ -1,7 +1,5 @@
#include "../port/portfns.h"
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
/* l.s */
extern void sev(void);
extern int tas(void *);
--- a/sys/src/9/cycv/fns.h
+++ b/sys/src/9/cycv/fns.h
@@ -16,7 +16,6 @@
KMap* kmap(Page *);
void kunmap(KMap *);
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define getpgcolor(a) 0
#define kmapinval()
#define KADDR(a) kaddr(a)
--- a/sys/src/9/kw/fns.h
+++ b/sys/src/9/kw/fns.h
@@ -143,8 +143,6 @@
#define getpgcolor(a) 0
#define kmapinval()
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
/*
* this low-level printing stuff is ugly,
* but there appears to be no other way to
--- a/sys/src/9/mtx/fns.h
+++ b/sys/src/9/mtx/fns.h
@@ -89,6 +89,5 @@
#define userureg(ur) (((ur)->status & MSR_PR) != 0)
void watchreset(void);
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define KADDR(a) ((void*)((ulong)(a)|KZERO))
#define PADDR(a) ((ulong)(a)&~KZERO)
--- a/sys/src/9/omap/fns.h
+++ b/sys/src/9/omap/fns.h
@@ -160,8 +160,6 @@
#define getpgcolor(a) 0
#define kmapinval()
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
#define KADDR(pa) ((void*)(KZERO | ((uintptr)(pa) & ~KSEGM)))
#define PADDR(va) (PHYSDRAM | ((uintptr)(va) & ~KSEGM))
--- a/sys/src/9/pc/fns.h
+++ b/sys/src/9/pc/fns.h
@@ -175,6 +175,5 @@
void rdrandbuf(void*, ulong);
#define userureg(ur) (((ur)->cs & 3) == 3)
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define KADDR(a) kaddr(a)
#define PADDR(a) paddr((void*)(a))
--- a/sys/src/9/pc64/fns.h
+++ b/sys/src/9/pc64/fns.h
@@ -177,6 +177,5 @@
void rdrandbuf(void*, ulong);
#define userureg(ur) (((ur)->cs & 3) == 3)
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define KADDR(a) kaddr(a)
#define PADDR(a) paddr((void*)(a))
--- a/sys/src/9/port/portfns.h
+++ b/sys/src/9/port/portfns.h
@@ -230,6 +230,7 @@
void pexit(char*, int);
void pgrpcpy(Pgrp*, Pgrp*);
ulong pidalloc(Proc*);
+#define waserror() setlabel(&up->errlab[up->nerrlab++])
#define poperror() up->nerrlab--
void portcountpagerefs(ulong*, int);
int postnote(Proc*, int, char*, int);
--- a/sys/src/9/ppc/fns.h
+++ b/sys/src/9/ppc/fns.h
@@ -100,7 +100,6 @@
void trapinit(void);
void trapvec(void);
#define userureg(ur) (((ur)->status & MSR_PR) != 0)
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define KADDR(a) ((void*)((ulong)(a)|KZERO))
#define PADDR(a) ((((ulong)(a)&0xf0000000)==0xf0000000)?(ulong)(a):((ulong)(a)&~KZERO))
#define coherence() eieio()
--- a/sys/src/9/sgi/fns.h
+++ b/sys/src/9/sgi/fns.h
@@ -63,8 +63,6 @@
#define PTR2UINT(p) ((uintptr)(p))
#define UINT2PTR(i) ((void*)(i))
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
#define KADDR(a) ((void*)((ulong)(a)|KSEG0))
#define PADDR(a) ((ulong)(a)&~KSEGM)
--- a/sys/src/9/teg2/fns.h
+++ b/sys/src/9/teg2/fns.h
@@ -194,8 +194,6 @@
#define getpgcolor(a) 0
#define kmapinval()
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
-
#define KADDR(pa) ((void*)(KZERO | ((uintptr)(pa) & ~KSEGM)))
#define PADDR(va) (PHYSDRAM | ((uintptr)(va) & ~KSEGM))
--- a/sys/src/9/xen/fns.h
+++ b/sys/src/9/xen/fns.h
@@ -92,7 +92,6 @@
uint xchgb(uchar*, uint);
void rdrandbuf(void*, ulong);
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define KADDR(a) ((void*)((ulong)(a)|KZERO))
#define PADDR(a) ((ulong)(a)&~KZERO)
--- a/sys/src/9/zynq/fns.h
+++ b/sys/src/9/zynq/fns.h
@@ -16,7 +16,6 @@
KMap* kmap(Page *);
void kunmap(KMap *);
-#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
#define getpgcolor(a) 0
#define kmapinval()
#define KADDR(a) kaddr(a)