summaryrefslogtreecommitdiff
path: root/linux/src/include
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-08-04 21:02:22 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:12 +0200
commitbaf29c7a7fe74d8ca799c869440f7b7cd5a33b8a (patch)
tree1aa311c95f00f763667f2d8fb2c15a115825775a /linux/src/include
parent2d38d0f995f30c5f04dcc0c10052f6c335f99987 (diff)
2007-08-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
* linux/dev/arch/i386/kernel/irq.c: Include <asm/hardirq.h>. (local_bh_count, local_irq_count, global_irq_holder, global_irq_lock) (global_irq_count, check_smp_invalidate, show, wait_on_bh) (wait_on_irq, synchronize_bh, synchronize_irq, get_irqlock) (__global_cli, __global_sti, __global_save_flags) (__global_restore_flags): New variables and functions from Linux 2.2 * linux/src/drivers/net/3c515.c (test_and_set_bit): Remove macro. * linux/src/drivers/net/de4x5.c (test_and_set_bit): Remove macro. * linux/src/drivers/net/eth16i.c (test_and_set_bit): Remove macro. * linux/src/drivers/net/kern_compat.h (test_and_set_bit): Remove macro. * linux/src/drivers/net/pcnet32.c (test_and_set_bit): Remove macro. * linux/src/include/linux/compatmac.h (test_and_set_bit) (test_and_clear_bit): Remove macro. * linux/src/include/asm-i386/atomic.h (atomic_read): New macro. * linux/src/include/asm-i386/bitops.h (test_and_set_bit) (test_and_clear_bit, test_and_change_bit): New inline functions. * linux/src/include/asm-i386/hardirq.h (local_bh_count): New declaration. * linux/src/include/linux/tasks.h (NR_CPUS): Set to NCPUS. (NO_PROC_ID): New macro.
Diffstat (limited to 'linux/src/include')
-rw-r--r--linux/src/include/asm-i386/atomic.h2
-rw-r--r--linux/src/include/asm-i386/bitops.h34
-rw-r--r--linux/src/include/asm-i386/hardirq.h1
-rw-r--r--linux/src/include/linux/compatmac.h4
-rw-r--r--linux/src/include/linux/tasks.h8
5 files changed, 42 insertions, 7 deletions
diff --git a/linux/src/include/asm-i386/atomic.h b/linux/src/include/asm-i386/atomic.h
index 1b9d99f..7e5dd06 100644
--- a/linux/src/include/asm-i386/atomic.h
+++ b/linux/src/include/asm-i386/atomic.h
@@ -21,6 +21,8 @@
typedef int atomic_t;
+#define atomic_read(v) (*v)
+
static __inline__ void atomic_add(atomic_t i, atomic_t *v)
{
__asm__ __volatile__(
diff --git a/linux/src/include/asm-i386/bitops.h b/linux/src/include/asm-i386/bitops.h
index d3ed1fb..fc4cf19 100644
--- a/linux/src/include/asm-i386/bitops.h
+++ b/linux/src/include/asm-i386/bitops.h
@@ -61,6 +61,40 @@ extern __inline__ int change_bit(int nr, SMPVOL void * addr)
return oldbit;
}
+extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+{
+ int oldbit;
+
+ __asm__ __volatile__( LOCK_PREFIX
+ "btsl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
+ :"Ir" (nr));
+ return oldbit;
+}
+
+extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+{
+ int oldbit;
+
+ __asm__ __volatile__( LOCK_PREFIX
+ "btrl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
+ :"Ir" (nr));
+ return oldbit;
+}
+
+extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+{
+ int oldbit;
+
+ __asm__ __volatile__( LOCK_PREFIX
+ "btcl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
+ :"Ir" (nr));
+ return oldbit;
+}
+
+
/*
* This routine doesn't need to be atomic.
*/
diff --git a/linux/src/include/asm-i386/hardirq.h b/linux/src/include/asm-i386/hardirq.h
index 5339613..10dae41 100644
--- a/linux/src/include/asm-i386/hardirq.h
+++ b/linux/src/include/asm-i386/hardirq.h
@@ -4,6 +4,7 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
+extern unsigned int local_bh_count[NR_CPUS];
/*
* Are we in an interrupt context? Either doing bottom half
diff --git a/linux/src/include/linux/compatmac.h b/linux/src/include/linux/compatmac.h
index 5f9175d..b9a4112 100644
--- a/linux/src/include/linux/compatmac.h
+++ b/linux/src/include/linux/compatmac.h
@@ -111,8 +111,8 @@ static inline void *ioremap(unsigned long base, long length)
#define time_after(t1,t2) (((long)t1-t2) > 0)
-#define test_and_set_bit(nr, addr) set_bit(nr, addr)
-#define test_and_clear_bit(nr, addr) clear_bit(nr, addr)
+//#define test_and_set_bit(nr, addr) set_bit(nr, addr)
+//#define test_and_clear_bit(nr, addr) clear_bit(nr, addr)
/* Not yet implemented on 2.0 */
#define ASYNC_SPD_SHI -1
diff --git a/linux/src/include/linux/tasks.h b/linux/src/include/linux/tasks.h
index 4540e34..466560e 100644
--- a/linux/src/include/linux/tasks.h
+++ b/linux/src/include/linux/tasks.h
@@ -5,14 +5,12 @@
* This is the maximum nr of tasks - change it if you need to
*/
-#ifdef __SMP__
-#define NR_CPUS 32 /* Max processors that can be running in SMP */
-#else
-#define NR_CPUS 1
-#endif
+#define NR_CPUS NCPUS /* Max processors that can be running in SMP */
#define NR_TASKS 512
+#define NO_PROC_ID -1
+
#define MAX_TASKS_PER_USER (NR_TASKS/2)
#define MIN_TASKS_LEFT_FOR_ROOT 4