summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-23 02:25:38 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-23 02:25:38 +0000
commit16b5d462f73eb29d1f67fa01cc1ea66afdc72569 (patch)
tree5407bd573f4840e473ea27cbe61e5c7a07131fcd /include/asm-sparc64
parentce8a076e11e7e5ee36007f9a3eee5bb3744cb8f6 (diff)
Merge with Linux 2.3.99-pre2.
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/atomic.h61
-rw-r--r--include/asm-sparc64/mman.h9
-rw-r--r--include/asm-sparc64/page.h4
-rw-r--r--include/asm-sparc64/parport.h3
-rw-r--r--include/asm-sparc64/pci.h7
-rw-r--r--include/asm-sparc64/semaphore.h16
-rw-r--r--include/asm-sparc64/spinlock.h44
7 files changed, 51 insertions, 93 deletions
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 96ef1a585..db3cd5831 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -1,61 +1,32 @@
-/* $Id: atomic.h,v 1.19 1999/07/03 22:11:17 davem Exp $
+/* $Id: atomic.h,v 1.20 2000/03/16 16:44:44 davem Exp $
* atomic.h: Thankfully the V9 is at least reasonable for this
* stuff.
*
- * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
*/
#ifndef __ARCH_SPARC64_ATOMIC__
#define __ARCH_SPARC64_ATOMIC__
-/* Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-#define __atomic_fool_gcc(x) ((struct { int a[100]; } *)x)
-
typedef struct { int counter; } atomic_t;
#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)
-#define atomic_add_return(__i, __v) \
-({ register atomic_t *__V asm("g1"); \
- register int __I asm("g2"); \
- __V = (__v); __I = (__i); \
- __asm__ __volatile__("sethi %%hi(__atomic_add), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__atomic_add), %%g3\n\t" \
- " nop\n1:" \
- : "=&r" (__I) \
- : "0" (__I), "r" (__V) \
- : "g3", "g5", "g7", "cc", "memory"); \
- __I; \
-})
-
-#define atomic_sub_return(__i, __v) \
-({ register atomic_t *__V asm("g1"); \
- register int __I asm("g2"); \
- __V = (__v); __I = (__i); \
- __asm__ __volatile__("sethi %%hi(__atomic_sub), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__atomic_sub), %%g3\n\t" \
- " nop\n1:" \
- : "=&r" (__I) \
- : "0" (__I), "r" (__V) \
- : "g3", "g5", "g7", "cc", "memory"); \
- __I; \
-})
-
-#define atomic_add(i, v) atomic_add_return(i, v)
-#define atomic_sub(i, v) atomic_sub_return(i, v)
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-
-#define atomic_inc(v) atomic_add(1,(v))
-#define atomic_dec(v) atomic_sub(1,(v))
+extern int __atomic_add(int, atomic_t *);
+extern int __atomic_sub(int, atomic_t *);
+
+#define atomic_add(i, v) ((void)__atomic_add(i, v))
+#define atomic_sub(i, v) ((void)__atomic_sub(i, v))
+
+#define atomic_dec_return(v) __atomic_sub(1, v)
+#define atomic_inc_return(v) __atomic_add(1, v)
+
+#define atomic_sub_and_test(i, v) (__atomic_sub(i, v) == 0)
+#define atomic_dec_and_test(v) (__atomic_sub(1, v) == 0)
+
+#define atomic_inc(v) ((void)__atomic_add(1, v))
+#define atomic_dec(v) ((void)__atomic_sub(1, v))
#endif /* !(__ARCH_SPARC64_ATOMIC__) */
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index bfb510af7..553e42906 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -1,4 +1,4 @@
-/* $Id: mman.h,v 1.1 1996/12/02 00:07:29 davem Exp $ */
+/* $Id: mman.h,v 1.2 2000/03/15 02:44:26 davem Exp $ */
#ifndef __SPARC64_MMAN_H__
#define __SPARC64_MMAN_H__
@@ -42,6 +42,13 @@
#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
+#define MADV_NORMAL 0x0 /* default page-in behavior */
+#define MADV_RANDOM 0x1 /* page-in minimum required */
+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
+#define MADV_WILLNEED 0x3 /* pre-fault pages */
+#define MADV_DONTNEED 0x4 /* discard these pages */
+#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
+
/* compatibility flags */
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FILE 0
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index 7653f4af1..757f43c4d 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -1,4 +1,4 @@
-/* $Id: page.h,v 1.30 2000/02/16 07:34:54 davem Exp $ */
+/* $Id: page.h,v 1.32 2000/03/15 07:19:28 davem Exp $ */
#ifndef _SPARC64_PAGE_H
#define _SPARC64_PAGE_H
@@ -23,6 +23,8 @@
extern void clear_page(void *page);
extern void copy_page(void *to, void *from);
+extern void clear_user_page(void *page, unsigned long vaddr);
+extern void copy_user_page(void *to, void *from, unsigned long vaddr);
/* GROSS, defining this makes gcc pass these types as aggregates,
* and thus on the stack, turn this crap off... -DaveM
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index dac004a6b..6840476dd 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -1,4 +1,4 @@
-/* $Id: parport.h,v 1.7 2000/01/28 13:43:14 jj Exp $
+/* $Id: parport.h,v 1.9 2000/03/16 07:47:27 davem Exp $
* parport.h: sparc64 specific parport initialization and dma.
*
* Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be)
@@ -7,7 +7,6 @@
#ifndef _ASM_SPARC64_PARPORT_H
#define _ASM_SPARC64_PARPORT_H 1
-#include <linux/config.h>
#include <asm/ebus.h>
#include <asm/ns87303.h>
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 267cbf797..1fd24a47f 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -1,6 +1,8 @@
#ifndef __SPARC64_PCI_H
#define __SPARC64_PCI_H
+#ifdef __KERNEL__
+
/* Can be used to override the logic in pci_scan_bus for skipping
* already-configured bus numbers - to be used for buggy BIOSes
* or architectures with incomplete PCI setup by the loader.
@@ -10,7 +12,10 @@
#define PCIBIOS_MIN_IO 0UL
#define PCIBIOS_MIN_MEM 0UL
-#ifdef __KERNEL__
+extern inline void pcibios_set_master(struct pci_dev *dev)
+{
+ /* No special bus mastering setup handling */
+}
/* Dynamic DMA mapping stuff.
*/
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h
index 1d7b0e31c..85ae21c9d 100644
--- a/include/asm-sparc64/semaphore.h
+++ b/include/asm-sparc64/semaphore.h
@@ -90,7 +90,7 @@ extern __inline__ void down(struct semaphore * sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__down)
+ : : "r" (sem), "i" (__down)
: "g5", "g7", "memory", "cc");
}
@@ -126,7 +126,7 @@ extern __inline__ int down_interruptible(struct semaphore *sem)
restore %%o0, %%g0, %0
.previous\n"
: "=r" (ret)
- : "0" (ret), "r" (__atomic_fool_gcc(sem)), "i" (__down_interruptible)
+ : "0" (ret), "r" (sem), "i" (__down_interruptible)
: "g5", "g7", "memory", "cc");
return ret;
}
@@ -162,7 +162,7 @@ extern inline int down_trylock(struct semaphore *sem)
restore %%o0, %%g0, %0
.previous\n"
: "=r" (ret)
- : "0" (ret), "r" (__atomic_fool_gcc(sem)), "i" (__down_trylock)
+ : "0" (ret), "r" (sem), "i" (__down_trylock)
: "g5", "g7", "memory", "cc");
return ret;
}
@@ -196,7 +196,7 @@ extern __inline__ void up(struct semaphore * sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__up)
+ : : "r" (sem), "i" (__up)
: "g5", "g7", "memory", "cc");
}
@@ -309,7 +309,7 @@ extern inline void down_read(struct rw_semaphore *sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__down_read_failed)
+ : : "r" (sem), "i" (__down_read_failed)
: "g5", "g7", "memory", "cc");
#if WAITQUEUE_DEBUG
if (test_le_bit(1, &sem->granted))
@@ -348,7 +348,7 @@ extern inline void down_write(struct rw_semaphore *sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__down_write_failed)
+ : : "r" (sem), "i" (__down_write_failed)
: "g5", "g7", "memory", "cc");
#if WAITQUEUE_DEBUG
if (atomic_read(&sem->writers))
@@ -394,7 +394,7 @@ extern inline void __up_read(struct rw_semaphore *sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__rwsem_wake)
+ : : "r" (sem), "i" (__rwsem_wake)
: "g5", "g7", "memory", "cc");
}
@@ -430,7 +430,7 @@ extern inline void __up_write(struct rw_semaphore *sem)
ba,pt %%xcc, 2b
restore %%l3, %%g0, %%g3
.previous\n"
- : : "r" (__atomic_fool_gcc(sem)), "i" (__rwsem_wake)
+ : : "r" (sem), "i" (__rwsem_wake)
: "g5", "g7", "memory", "cc");
}
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index c4e571564..ea34fbefe 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -110,41 +110,15 @@ extern int _spin_trylock (spinlock_t *lock);
typedef unsigned int rwlock_t;
#define RW_LOCK_UNLOCKED 0
-#define read_lock(__rw_lck) \
-do { register rwlock_t *__X asm("g1"); \
- __asm__ __volatile__("sethi %%hi(__read_lock), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__read_lock), %%g3\n\t" \
- " nop\n1:" \
- : : "r" (__X = (__rw_lck)) \
- : "g3", "g5", "g7", "cc", "memory"); \
-} while(0)
-
-#define read_unlock(__rw_lck) \
-do { register rwlock_t *__X asm("g1"); \
- __asm__ __volatile__("sethi %%hi(__read_unlock), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__read_unlock), %%g3\n\t" \
- " nop\n1:" \
- : : "r" (__X = (__rw_lck)) \
- : "g3", "g5", "g7", "cc", "memory"); \
-} while(0)
-
-#define write_lock(__rw_lck) \
-do { register rwlock_t *__X asm("g1"); \
- __asm__ __volatile__("sethi %%hi(__write_lock), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__write_lock), %%g3\n\t" \
- " nop\n1:" \
- : : "r" (__X = (__rw_lck)) \
- : "g2", "g3", "g5", "g7", "cc", "memory"); \
-} while(0)
-
-#define write_unlock(__rw_lck) \
-do { register rwlock_t *__X asm("g1"); \
- __asm__ __volatile__("sethi %%hi(__write_unlock), %%g3\n\t" \
- "jmpl %%g3 + %%lo(__write_unlock), %%g3\n\t" \
- " nop\n1:" \
- : : "r" (__X = (__rw_lck)) \
- : "g2", "g3", "g5", "g7", "cc", "memory"); \
-} while(0)
+extern void __read_lock(rwlock_t *);
+extern void __read_unlock(rwlock_t *);
+extern void __write_lock(rwlock_t *);
+extern void __write_unlock(rwlock_t *);
+
+#define read_lock(p) __read_lock(p)
+#define read_unlock(p) __read_unlock(p)
+#define write_lock(p) __write_lock(p)
+#define write_unlock(p) __write_unlock(p)
#else /* !(SPIN_LOCK_DEBUG) */