summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-05 22:22:31 +0000
committerjhb <jhb@FreeBSD.org>2000-10-05 22:22:31 +0000
commit56c453e430328f9996e7cb8ea72523cc037a3eaf (patch)
treec73062b25789c150c991b8ecccfa419f5b77122b /sys
parent4cc9f87fa24c6b90c1d657b2704432cbea1b7bea (diff)
downloadFreeBSD-src-56c453e430328f9996e7cb8ea72523cc037a3eaf.zip
FreeBSD-src-56c453e430328f9996e7cb8ea72523cc037a3eaf.tar.gz
Replace loadandclear() with atomic_readandclear_int().
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c4
-rw-r--r--sys/amd64/include/cpufunc.h11
-rw-r--r--sys/i386/i386/pmap.c4
-rw-r--r--sys/i386/include/cpufunc.h11
4 files changed, 4 insertions, 26 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 52d9cd1..523ef5d 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1603,7 +1603,7 @@ pmap_remove_pte(pmap, ptq, va)
unsigned oldpte;
vm_page_t m;
- oldpte = loadandclear(ptq);
+ oldpte = atomic_readandclear_int(ptq);
if (oldpte & PG_W)
pmap->pm_stats.wired_count -= 1;
/*
@@ -1799,7 +1799,7 @@ pmap_remove_all(m)
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
- tpte = loadandclear(pte);
+ tpte = atomic_readandclear_int(pte);
if (tpte & PG_W)
pv->pv_pmap->pm_stats.wired_count--;
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 39868df..317af1b 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -305,16 +305,6 @@ inw(u_int port)
return (data);
}
-static __inline u_int
-loadandclear(volatile u_int *addr)
-{
- u_int result;
-
- __asm __volatile("xorl %0,%0; xchgl %1,%0"
- : "=&r" (result) : "m" (*addr));
- return (result);
-}
-
static __inline void
outbv(u_int port, u_char data)
{
@@ -525,7 +515,6 @@ void invd __P((void));
void invlpg __P((u_int addr));
void invltlb __P((void));
u_short inw __P((u_int port));
-u_int loadandclear __P((u_int *addr));
void outb __P((u_int port, u_char data));
void outl __P((u_int port, u_int data));
void outsb __P((u_int port, void *addr, size_t cnt));
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 52d9cd1..523ef5d 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -1603,7 +1603,7 @@ pmap_remove_pte(pmap, ptq, va)
unsigned oldpte;
vm_page_t m;
- oldpte = loadandclear(ptq);
+ oldpte = atomic_readandclear_int(ptq);
if (oldpte & PG_W)
pmap->pm_stats.wired_count -= 1;
/*
@@ -1799,7 +1799,7 @@ pmap_remove_all(m)
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
- tpte = loadandclear(pte);
+ tpte = atomic_readandclear_int(pte);
if (tpte & PG_W)
pv->pv_pmap->pm_stats.wired_count--;
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 39868df..317af1b 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -305,16 +305,6 @@ inw(u_int port)
return (data);
}
-static __inline u_int
-loadandclear(volatile u_int *addr)
-{
- u_int result;
-
- __asm __volatile("xorl %0,%0; xchgl %1,%0"
- : "=&r" (result) : "m" (*addr));
- return (result);
-}
-
static __inline void
outbv(u_int port, u_char data)
{
@@ -525,7 +515,6 @@ void invd __P((void));
void invlpg __P((u_int addr));
void invltlb __P((void));
u_short inw __P((u_int port));
-u_int loadandclear __P((u_int *addr));
void outb __P((u_int port, u_char data));
void outl __P((u_int port, u_int data));
void outsb __P((u_int port, void *addr, size_t cnt));
OpenPOWER on IntegriCloud