summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-03 09:23:20 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-03 09:23:20 +0000
commitac5ff8f4a72f7b4e66f73c3c6cb9fe7758cf6f12 (patch)
tree9fc7f8ce32e0d9a4aa055b2a58a05a5d727b333c /include/asm-sparc
parent52662ff3e66770fd7e4fc508c91056d29c08bff0 (diff)
Sync with Linux 2.1.42.
Diffstat (limited to 'include/asm-sparc')
-rw-r--r--include/asm-sparc/byteorder.h18
-rw-r--r--include/asm-sparc/irq.h8
-rw-r--r--include/asm-sparc/semaphore.h39
-rw-r--r--include/asm-sparc/string.h6
-rw-r--r--include/asm-sparc/unistd.h4
5 files changed, 38 insertions, 37 deletions
diff --git a/include/asm-sparc/byteorder.h b/include/asm-sparc/byteorder.h
index 6fd6d02e2..758324f39 100644
--- a/include/asm-sparc/byteorder.h
+++ b/include/asm-sparc/byteorder.h
@@ -1,17 +1,17 @@
-/* $Id: byteorder.h,v 1.12 1996/12/19 08:08:20 davem Exp $ */
+/* $Id: byteorder.h,v 1.13 1997/05/26 23:37:46 davem Exp $ */
#ifndef _SPARC_BYTEORDER_H
#define _SPARC_BYTEORDER_H
-#define ntohl(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define htons(x) (x)
+#define ntohl(x) ((unsigned long int)(x))
+#define ntohs(x) ((unsigned short int)(x))
+#define htonl(x) ((unsigned long int)(x))
+#define htons(x) ((unsigned short int)(x))
/* Some programs depend upon these being around. */
-#define __constant_ntohl(x) (x)
-#define __constant_ntohs(x) (x)
-#define __constant_htonl(x) (x)
-#define __constant_htons(x) (x)
+#define __constant_ntohl(x) ((unsigned long int)(x))
+#define __constant_ntohs(x) ((unsigned short int)(x))
+#define __constant_htonl(x) ((unsigned long int)(x))
+#define __constant_htons(x) ((unsigned short int)(x))
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN 4321
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index daac48d56..811bf524a 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.19 1997/05/08 20:57:39 davem Exp $
+/* $Id: irq.h,v 1.20 1997/05/28 05:25:07 davem Exp $
* irq.h: IRQ registers on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -24,7 +24,7 @@
extern void irq_enter(int cpu, int irq, void *regs);
extern void irq_exit(int cpu, int irq);
#else
-extern __inline__ void irq_enter(int cpu, int irq)
+extern __inline__ void irq_enter(int cpu, int irq, void *regs)
{
register int proc asm("g1");
proc = cpu;
@@ -51,8 +51,8 @@ extern __inline__ void irq_exit(int cpu, int irq)
}
#endif /* DEBUG_IRQLOCK */
#else
-#define irq_enter(cpu, irq) (local_irq_count[cpu]++)
-#define irq_exit(cpu, irq) (local_irq_count[cpu]--)
+#define irq_enter(cpu, irq, regs) (local_irq_count[cpu]++)
+#define irq_exit(cpu, irq) (local_irq_count[cpu]--)
#endif
/* Dave Redman (djhr@tadpole.co.uk)
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h
index eac2160e7..2832f8ed4 100644
--- a/include/asm-sparc/semaphore.h
+++ b/include/asm-sparc/semaphore.h
@@ -9,12 +9,12 @@
struct semaphore {
atomic_t count;
- atomic_t waking;
+ int waking;
struct wait_queue * wait;
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL })
+#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
@@ -22,23 +22,24 @@ extern void __up(struct semaphore * sem);
#define sema_init(sem, val) atomic_set(&((sem)->count), val)
-#define wake_one_more(sem) atomic_inc(&sem->waking);
+#define wake_one_more(sem) \
+do { \
+ unsigned long flags; \
+ save_and_cli(flags); \
+ sem->waking++; \
+ restore_flags(flags); \
+} while(0)
-/* XXX Put this in raw assembler for SMP case so that the atomic_t
- * XXX spinlock can allow this to be done without grabbing the IRQ
- * XXX global lock.
- */
-#define waking_non_zero(sem) \
-({ unsigned long flags; \
- int ret = 0; \
- save_flags(flags); \
- cli(); \
- if (atomic_read(&sem->waking) > 0) { \
- atomic_dec(&sem->waking); \
- ret = 1; \
- } \
- restore_flags(flags); \
- ret; \
+#define waking_non_zero(sem) \
+({ unsigned long flags; \
+ int ret = 0; \
+ save_and_cli(flags); \
+ if (sem->waking > 0) { \
+ sem->waking--; \
+ ret = 1; \
+ } \
+ restore_flags(flags); \
+ ret; \
})
/* This isn't quite as clever as the x86 side, I'll be fixing this
diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h
index d4ed14b26..7fa65510f 100644
--- a/include/asm-sparc/string.h
+++ b/include/asm-sparc/string.h
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.31 1997/05/03 02:02:12 davem Exp $
+/* $Id: string.h,v 1.32 1997/05/20 07:58:59 jj Exp $
* string.h: External definitions for optimized assembly string
* routines for the Linux Kernel.
*
@@ -34,7 +34,7 @@ extern __kernel_size_t __memset(void *,int,__kernel_size_t);
extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n)
{
- extern void (*__copy_1page)(void *, const void *);
+ extern void __copy_1page(void *, const void *);
if(n <= 32) {
__builtin_memcpy(to, from, n);
@@ -67,7 +67,7 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si
extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count)
{
- extern void (*bzero_1page)(void *);
+ extern void bzero_1page(void *);
extern __kernel_size_t __bzero(void *, __kernel_size_t);
if(!c) {
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index cf33b2a51..3655fd34f 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.32 1997/04/11 00:42:23 davem Exp $ */
+/* $Id: unistd.h,v 1.33 1997/05/21 10:21:55 jj Exp $ */
#ifndef _SPARC_UNISTD_H
#define _SPARC_UNISTD_H
@@ -428,7 +428,7 @@ static __inline__ _syscall0(int,idle)
static __inline__ _syscall0(int,fork)
static __inline__ _syscall2(int,clone,unsigned long,flags,char *,ksp)
static __inline__ _syscall0(int,pause)
-static __inline__ _syscall0(int,setup)
+static __inline__ _syscall1(int,setup,int,magic)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)