From: Andy P. <at...@us...> - 2001-01-18 15:52:27
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv5429/include/asm-vax Modified Files: dz11.h hardirq.h io.h mman.h mmu_context.h processor.h resource.h semaphore.h serial.h shmparam.h system.h termios.h Added Files: module.h shmbuf.h Log Message: Updates to adapt code base from 2.2 to 2.4 tree. Sync up to atp 2.4 tree. --- NEW FILE --- #ifndef _ASM_VAX_MODULE_H #define _ASM_VAX_MODULE_H /* * This file contains the vax architecture specific module code. */ #define module_map(x) vmalloc(x) #define module_unmap(x) vfree(x) #define module_arch_init(x) (0) #endif /* _ASM_VAX_MODULE_H */ --- NEW FILE --- #ifndef __VAX_SHMBUF_H #define __VAX_SHMBUF_H /* * The shmid64_ds structure for VAX architecture. * Note extra padding because this structure is passed back and forth * between kernel and user space. * * Pad space is left for: * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ __kernel_time_t shm_atime; /* last attach time */ unsigned long __unused1; __kernel_time_t shm_dtime; /* last detach time */ unsigned long __unused2; __kernel_time_t shm_ctime; /* last change time */ unsigned long __unused3; __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ unsigned long shm_nattch; /* no. of current attaches */ unsigned long __unused4; unsigned long __unused5; }; struct shminfo64 { unsigned long shmmax; unsigned long shmmin; unsigned long shmmni; unsigned long shmseg; unsigned long shmall; unsigned long __unused1; unsigned long __unused2; unsigned long __unused3; unsigned long __unused4; }; #endif /* __VAX_SHMBUF_H */ Index: dz11.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/dz11.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dz11.h 2001/01/17 16:18:52 1.1 --- dz11.h 2001/01/18 15:52:28 1.2 *************** *** 9,12 **** --- 9,14 ---- * Definitions for DZ11-compatible RS232 I/O chips. If all this * works, this will obsolete all the DC7085 stuff. + * + * Jan 2001 atp - updated to 2.4. * * Reference: DZQ11 Asynchronous Multiplexer Users Guide *************** *** 17,20 **** --- 19,23 ---- #include <linux/types.h> + #include <linux/serialP.h> struct dz11_regs { Index: hardirq.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/hardirq.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** hardirq.h 2001/01/17 16:18:52 1.1 --- hardirq.h 2001/01/18 15:52:28 1.2 *************** *** 19,23 **** ! extern unsigned int local_irq_count[NR_CPUS]; /* --- 19,23 ---- ! /*extern unsigned int local_irq_count[NR_CPUS];*/ /* *************** *** 25,39 **** * or hardware interrupt processing? */ ! #define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) ! #define in_irq() (local_irq_count(smp_processor_id()) != 0) #ifndef __SMP__ ! #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) ! #define hardirq_enter(cpu) (local_irq_count[cpu]++) ! #define hardirq_exit(cpu) (local_irq_count[cpu]--) #define synchronize_irq() do { } while (0) --- 25,38 ---- * or hardware interrupt processing? */ ! #define in_interrupt() (local_irq_count(smp_processor_id()) + local_bh_count(smp_processor_id()) != 0) #define in_irq() (local_irq_count(smp_processor_id()) != 0) #ifndef __SMP__ ! #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0) #define hardirq_endlock(cpu) do { } while (0) ! #define hardirq_enter(cpu) (local_irq_count(cpu)++) ! #define hardirq_exit(cpu) (local_irq_count(cpu)--) #define synchronize_irq() do { } while (0) Index: io.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/io.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** io.h 2001/01/17 16:18:52 1.1 --- io.h 2001/01/18 15:52:28 1.2 *************** *** 1,43 **** ! #ifndef _VAX_IO_H ! #define _VAX_IO_H ! /* FIXME: -- entire file. ! * need to decide on how to deal with device address space ! * within the context of UBA etc devices, Although the initial ! * port is targetted at 'busless' vaxes, we still need to ! * think about the best way of doing this to include the ! * bigger vaxen */ ! /* this taken from m68k port. represents the simple case */ ! #ifdef __KERNEL__ ! ! #include <linux/config.h> ! ! /* hardly likely to need this on a vax, - still looking for a ! * SPEED_UP_IO define... */ - #define __SLOW_DOWN_IO "\n nop" - /* - * readX/writeX() are used to access memory mapped devices. On some - * architectures the memory mapped IO stuff needs to be accessed - * differently. On the m68k architecture, we just read/write the - * memory location directly. - */ ! #define inb_p(addr) readb(addr) ! #define inb(addr) readb(addr) ! ! #define outb(x,addr) ((void) writeb(x,addr)) ! #define outb_p(x,addr) outb(x,addr) - /* virt_to_phys stuff lifted from asm-i386 */ #include <linux/vmalloc.h> #include <asm/page.h> ! #include <asm/mm/virt_trans.h> /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed ! * differently. On the x86 architecture, we just read/write the ! * memory location directly. */ --- 1,28 ---- ! #ifndef __VAX_IO_H ! #define __VAX_IO_H ! /* atp Jan 2001, junked old io.h. ! * wasnt sure about old one, so it was easiest to ! * start afresh. */ ! #ifdef __KERNEL__ #include <linux/vmalloc.h> #include <asm/page.h> ! #include <asm/mm/virt_trans.h> /* virt_to_phys stuff */ + + /* FIXME: What is the proper value for this ? */ + + #define IO_SPACE_LIMIT 0xffffffff + + #define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x))) + #define __io_phys(x) ((unsigned long)(x) & ~PAGE_OFFSET) + /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed ! * differently. */ *************** *** 49,81 **** #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) - - #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) - #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) - #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) - - /* - * Again, i386 does not require mem IO specific function. - */ ! #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(b),(c),(d)) ! static inline int check_signature(unsigned long io_addr, ! const unsigned char *signature, int length) ! { ! int retval = 0; ! do { ! if (readb(io_addr) != *signature) ! goto out; ! io_addr++; ! signature++; ! length--; ! } while (length); ! retval = 1; ! out: ! return retval; ! } #endif /* __KERNEL__ */ ! #endif /* _VAX_IO_H */ --- 34,49 ---- #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) ! #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) ! #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) ! #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) ! #define inb_p(addr) readb(addr) ! #define inb(addr) readb(addr) + #define outb(x,addr) ((void) writeb(x,addr)) + #define outb_p(x,addr) outb(x,addr) #endif /* __KERNEL__ */ ! #endif /* __VAX_IO_H */ Index: mman.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mman.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mman.h 2001/01/17 16:18:52 1.1 --- mman.h 2001/01/18 15:52:28 1.2 *************** *** 26,29 **** --- 26,35 ---- #define MCL_FUTURE 2 /* lock all future mappings */ + #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 */ + /* compatibility flags */ #define MAP_ANON MAP_ANONYMOUS Index: mmu_context.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mmu_context.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mmu_context.h 2001/01/17 16:18:52 1.1 --- mmu_context.h 2001/01/18 15:52:28 1.2 *************** *** 1,12 **** ! #ifndef _ASM_VAX_MMU_CONTEXT_H ! #define _ASM_VAX_MMU_CONTEXT_H ! /* FIXME: check this. dont think we need it. Looks like a mips/alpha thing */ ! #define get_mmu_context(x) do { } while (0) ! ! #define init_new_context(mm) do { } while(0) ! #define destroy_context(mm) do { } while(0) ! #define activate_context(tsk) do { } while(0) ! ! #endif --- 1,6 ---- ! #ifndef __VAX_TMP_MMUCONTEXT_H ! #define __VAX_TMP_MMUCONTEXT_H ! #include <asm/mm/mmu_context.h> ! #endif /* __VAX_TMP_MMUCONTEXT_H */ Index: processor.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/processor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** processor.h 2001/01/17 16:18:52 1.1 --- processor.h 2001/01/18 15:52:28 1.2 *************** *** 74,84 **** /* This was what Andy had. I don't understand this stuff yet, ! but I'm going to replace it with something similar to the ! i386 version, just to get stuff to compile. We'll fix ! it later. KPH 2000-04-25 ! ! #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \ ! PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } */ ! #define INIT_MMAP { &init_mm, 0, 0, NULL, \ PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } --- 74,84 ---- /* This was what Andy had. I don't understand this stuff yet, ! * but I'm going to replace it with something similar to the ! * i386 version, just to get stuff to compile. We'll fix ! * it later. KPH 2000-04-25 ! * ! * #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \ ! * PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } ! */ #define INIT_MMAP { &init_mm, 0, 0, NULL, \ PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } *************** *** 95,100 **** --- 95,111 ---- } + + #include <asm/ptrace.h> + /* go with the flow here. Everyone else defines + * THREAD_SIZE to be 8192 or similar. FIXME: */ + + #define THREAD_SIZE (8192) + + + + + /* * Do necessary setup to start up a newly executed thread. *************** *** 111,115 **** extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ! #define copy_segments(nr, tsk, mm) do { } while (0) #define release_segments(mm) do { } while (0) #define forget_segments() do { } while (0) --- 122,126 ---- extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ! #define copy_segments(tsk, mm) do { } while (0) #define release_segments(mm) do { } while (0) #define forget_segments() do { } while (0) Index: resource.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** resource.h 2001/01/17 16:18:52 1.1 --- resource.h 2001/01/18 15:52:28 1.2 *************** *** 1,8 **** ! #ifndef _VAX_RESOURCE_H ! #define _VAX_RESOURCE_H /* * Resource limits - * FIXME: taken from alpha port. check this. atp 1998 */ --- 1,9 ---- ! #ifndef _ASM_VAX_RESOURCE_H ! #define _ASM_VAX_RESOURCE_H + /*atp jan 2001 - taken from pa-risc for 2.4 update */ + /* * Resource limits */ *************** *** 13,40 **** #define RLIMIT_CORE 4 /* max core file size */ #define RLIMIT_RSS 5 /* max resident set size */ ! #define RLIMIT_NOFILE 6 /* max number of open files */ ! #define RLIMIT_AS 7 /* address space limit(?) */ ! #define RLIMIT_NPROC 8 /* max number of processes */ ! #define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ ! #define RLIM_NLIMITS 10 #ifdef __KERNEL__ ! #define INIT_RLIMITS \ ! { \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_CPU */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_FSIZE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_DATA */ \ ! {_STK_LIM, _STK_LIM}, /* RLIMIT_STACK */ \ ! { 0, LONG_MAX}, /* RLIMIT_CORE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_RSS */ \ ! { NR_OPEN, NR_OPEN}, /* RLIMIT_NOFILE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_AS */ \ ! {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, /* RLIMIT_NPROC */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_MEMLOCK */ \ } #endif /* __KERNEL__ */ ! #endif /* _VAX_RESOURCE_H */ --- 14,49 ---- #define RLIMIT_CORE 4 /* max core file size */ #define RLIMIT_RSS 5 /* max resident set size */ ! #define RLIMIT_NPROC 6 /* max number of processes */ ! #define RLIMIT_NOFILE 7 /* max number of open files */ ! #define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ ! #define RLIMIT_AS 9 /* address space limit */ ! #define RLIMIT_LOCKS 10 /* maximum file locks held */ ! ! #define RLIM_NLIMITS 11 ! /* ! * SuS says limits have to be unsigned. ! * Which makes a ton more sense anyway. ! */ ! #define RLIM_INFINITY (~0UL) #ifdef __KERNEL__ ! #define INIT_RLIMITS \ ! { \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { _STK_LIM, 10 * _STK_LIM }, \ ! { 0, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { 0, 0 }, \ ! { INR_OPEN, INR_OPEN }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ } #endif /* __KERNEL__ */ ! #endif Index: semaphore.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/semaphore.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** semaphore.h 2001/01/17 16:18:52 1.1 --- semaphore.h 2001/01/18 15:52:28 1.2 *************** *** 2,5 **** --- 2,6 ---- #define _VAX_SEMAPHORE_H + /* * SMP- and interrupt-safe semaphores.. *************** *** 9,42 **** * VAX port atp Nov 1998. * - this makes my brain hurt. */ ! #include <asm/atomic.h> struct semaphore { atomic_t count; int waking; ! struct wait_queue * wait; }; ! #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); ! extern void __up(struct semaphore * sem); ! #define sema_init(sem, val) atomic_set(&((sem)->count), (val)) ! extern inline void down(struct semaphore * sem) { if (atomic_dec_return(&sem->count) < 0) __down(sem); } ! extern inline int down_interruptible(struct semaphore * sem) { int ret = 0; if (atomic_dec_return(&sem->count) < 0) ret = __down_interruptible(sem); --- 10,98 ---- * VAX port atp Nov 1998. * - this makes my brain hurt. + * - updated for 2.4 Jan 2001. New wait_queue_head_t plus misc software rot. + * Lifted from s390 and parisc */ ! #include <asm/system.h> #include <asm/atomic.h> + #include <linux/wait.h> /* wait_queue_head_t */ + #include <linux/linkage.h> struct semaphore { atomic_t count; int waking; ! wait_queue_head_t wait; ! #if WAITQUEUE_DEBUG ! long __magic; ! #endif }; + + #if WAITQUEUE_DEBUG + # define __SEM_DEBUG_INIT(name) \ + , (long)&(name).__magic + #else + # define __SEM_DEBUG_INIT(name) + #endif ! #define __SEMAPHORE_INITIALIZER(name,count) \ ! { ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ ! __SEM_DEBUG_INIT(name) } ! #define __MUTEX_INITIALIZER(name) \ ! __SEMAPHORE_INITIALIZER(name,1) ! #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ ! struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) + #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) + #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) + extern inline void sema_init (struct semaphore *sem, int val) + { + *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); + #if WAITQUEUE_DEBUG + sem->__magic = (long)&sem->__magic; + #endif + } ! static inline void init_MUTEX (struct semaphore *sem) { + sema_init(sem, 1); + } + + static inline void init_MUTEX_LOCKED (struct semaphore *sem) + { + sema_init(sem, 0); + } + + asmlinkage void __down_failed(void /* special register calling convention */); + asmlinkage int __down_failed_interruptible(void /* params in registers */); + asmlinkage int __down_failed_trylock(void /* params in registers */); + asmlinkage void __up_wakeup(void /* special register calling convention */); + + asmlinkage void __down(struct semaphore * sem); + asmlinkage int __down_interruptible(struct semaphore * sem); + asmlinkage int __down_trylock(struct semaphore * sem); + asmlinkage void __up(struct semaphore * sem); + + extern spinlock_t semaphore_wake_lock; + + + extern __inline__ void down(struct semaphore * sem) + { + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + if (atomic_dec_return(&sem->count) < 0) __down(sem); } ! extern __inline__ int down_interruptible(struct semaphore * sem) { int ret = 0; + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + if (atomic_dec_return(&sem->count) < 0) ret = __down_interruptible(sem); *************** *** 44,52 **** } ! extern inline void up(struct semaphore * sem) { if (atomic_inc_return(&sem->count) <= 0) __up(sem); ! } #endif /* !(_VAX_SEMAPHORE_H) */ --- 100,291 ---- } ! extern __inline__ int down_trylock(struct semaphore * sem) { + int ret = 0; + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + + if (atomic_dec_return(&sem->count) < 0) + ret = __down_trylock(sem); + return ret; + } + + /* + * Note! This is subtle. We jump to wake people up only if + * the semaphore was negative (== somebody was waiting on it). + */ + extern __inline__ void up(struct semaphore * sem) + { + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif if (atomic_inc_return(&sem->count) <= 0) __up(sem); ! } ! ! /* rw mutexes (should that be mutices? =) -- throw rw ! * spinlocks and semaphores together, and this is what we ! * end up with... ! * ! * The lock is initialized to BIAS. This way, a writer ! * subtracts BIAS ands gets 0 for the case of an uncontended ! * lock. Readers decrement by 1 and see a positive value ! * when uncontended, negative if there are writers waiting ! * (in which case it goes to sleep). ! * ! * The value 0x01000000 supports up to 128 processors and ! * lots of processes. BIAS must be chosen such that subl'ing ! * BIAS once per CPU will result in the long remaining ! * negative. ! * ! * In terms of fairness, this should result in the lock ! * flopping back and forth between readers and writers ! * under heavy use. ! * ! * -ben ! */ ! struct rw_semaphore { ! atomic_t count; ! volatile unsigned char write_bias_granted; ! volatile unsigned char read_bias_granted; ! volatile unsigned char pad1; ! volatile unsigned char pad2; ! wait_queue_head_t wait; ! wait_queue_head_t write_bias_wait; ! #if WAITQUEUE_DEBUG ! long __magic; ! atomic_t readers; ! atomic_t writers; ! #endif ! }; ! ! #if WAITQUEUE_DEBUG ! #define __RWSEM_DEBUG_INIT , ATOMIC_INIT(0), ATOMIC_INIT(0) ! #else ! #define __RWSEM_DEBUG_INIT /* */ ! #endif ! ! #define RW_LOCK_BIAS 0x01000000 ! ! #define __RWSEM_INITIALIZER(name,count) \ ! { ATOMIC_INIT(count), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ ! __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ ! __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } ! ! #define __DECLARE_RWSEM_GENERIC(name,count) \ ! struct rw_semaphore name = __RWSEM_INITIALIZER(name,count) ! ! #define DECLARE_RWSEM(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS) ! #define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1) ! #define DECLARE_RWSEM_WRITE_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,0) ! ! extern inline void init_rwsem(struct rw_semaphore *sem) ! { ! atomic_set(&sem->count, RW_LOCK_BIAS); ! sem->read_bias_granted = 0; ! sem->write_bias_granted = 0; ! init_waitqueue_head(&sem->wait); ! init_waitqueue_head(&sem->write_bias_wait); ! #if WAITQUEUE_DEBUG ! sem->__magic = (long)&sem->__magic; ! atomic_set(&sem->readers, 0); ! atomic_set(&sem->writers, 0); ! #endif ! } ! ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! extern struct rw_semaphore *__build_read_lock(struct rw_semaphore *sem, const char *what); ! extern struct rw_semaphore *__build_write_lock(struct rw_semaphore *sem, const char *what); ! #endif ! ! /* we use FASTCALL convention for the helpers */ ! extern struct rw_semaphore *FASTCALL(__down_read_failed(struct rw_semaphore *sem)); ! extern struct rw_semaphore *FASTCALL(__down_write_failed(struct rw_semaphore *sem)); ! extern struct rw_semaphore *FASTCALL(__rwsem_wake(struct rw_semaphore *sem)); ! ! extern inline void down_read(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->__magic != (long)&sem->__magic) ! BUG(); ! #endif ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! __build_read_lock(sem, "__down_read_failed"); ! #endif ! #if WAITQUEUE_DEBUG ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->writers)) ! BUG(); ! atomic_inc(&sem->readers); ! #endif ! } ! ! extern inline void down_write(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->__magic != (long)&sem->__magic) ! BUG(); ! #endif ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! __build_write_lock(sem, "__down_write_failed"); ! #endif ! #if WAITQUEUE_DEBUG ! if (atomic_read(&sem->writers)) ! BUG(); ! if (atomic_read(&sem->readers)) ! BUG(); ! if (sem->read_bias_granted) ! BUG(); ! if (sem->write_bias_granted) ! BUG(); ! atomic_inc(&sem->writers); ! #endif ! } ! ! /* When a reader does a release, the only significant ! * case is when there was a writer waiting, and we've ! * bumped the count to 0: we must wake the writer up. ! */ ! extern inline void __up_read(struct rw_semaphore *sem) ! { ! } ! ! /* releasing the writer is easy -- just release it and ! * wake up any sleepers. ! */ ! extern inline void __up_write(struct rw_semaphore *sem) ! { ! } ! ! extern inline void up_read(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->writers)) ! BUG(); ! atomic_dec(&sem->readers); ! #endif ! __up_read(sem); ! } ! ! extern inline void up_write(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->read_bias_granted) ! BUG(); ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->readers)) ! BUG(); ! if (atomic_read(&sem->writers) != 1) ! BUG(); ! atomic_dec(&sem->writers); ! #endif ! __up_write(sem); ! } ! #endif /* !(_VAX_SEMAPHORE_H) */ Index: serial.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/serial.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** serial.h 2001/01/17 16:18:52 1.1 --- serial.h 2001/01/18 15:52:28 1.2 *************** *** 1,8 **** ! #ifndef _VAX_SERIAL_H ! #define _VAX_SERIAL_H ! /* We don't have any PC-style UARTs, so we don't want drivers/char/serial.c ! do do anything. So, we leave SERIAL_PORT_DFNS empty */ ! #define SERIAL_PORT_DFNS ! #endif _VAX_SERIAL_H --- 1,84 ---- ! #ifndef __VAX_SERIAL_H ! #define __VAX_SERIAL_H ! /* serial.h */ ! /* Jan 2001 atp. Added. Not sure what the base clock for VAX ! * serial boards is - so go with 1.8Mhz at present ! */ ! #include <linux/config.h> ! ! /* ! * This assumes you have a 1.8432 MHz clock for your UART. ! * ! * It'd be nice if someone built a serial card with a 24.576 MHz ! * clock, since the 16550A is capable of handling a top speed of 1.5 ! * megabits/second; but this requires the faster clock. ! */ ! #define BASE_BAUD ( 1843200 / 16 ) ! ! /* Standard COM flags (except for COM4, because of the 8514 problem) */ ! #ifdef CONFIG_SERIAL_DETECT_IRQ ! #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) ! #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) ! #else ! #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) ! #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF ! #endif ! ! #ifdef CONFIG_SERIAL_MANY_PORTS ! #define FOURPORT_FLAGS ASYNC_FOURPORT ! #define ACCENT_FLAGS 0 ! #define BOCA_FLAGS 0 ! #define RS_TABLE_SIZE 64 ! #else ! #define RS_TABLE_SIZE 4 ! #endif ! ! #define STD_SERIAL_PORT_DEFNS \ ! /* UART CLK PORT IRQ FLAGS */ \ ! { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ ! { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ ! { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ ! { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ ! ! ! #ifdef CONFIG_SERIAL_MANY_PORTS ! #define EXTRA_SERIAL_PORT_DEFNS \ ! { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \ ! { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \ ! { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \ ! { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \ ! { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \ ! { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \ ! { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \ ! { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \ ! { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \ ! { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \ ! { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \ ! { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \ ! { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \ ! { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \ ! { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \ ! { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \ ! { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \ ! { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \ ! { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \ ! { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \ ! { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \ ! { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \ ! { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \ ! { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \ ! { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \ ! { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \ ! { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \ ! { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */ ! #else ! #define EXTRA_SERIAL_PORT_DEFNS ! #endif ! ! #define SERIAL_PORT_DFNS \ ! STD_SERIAL_PORT_DEFNS \ ! EXTRA_SERIAL_PORT_DEFNS ! ! #endif /* __VAX_SERIAL_H */ Index: shmparam.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/shmparam.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** shmparam.h 2001/01/17 16:18:52 1.1 --- shmparam.h 2001/01/18 15:52:28 1.2 *************** *** 1,46 **** ! #ifndef _VAX_SHMPARAM_H ! #define _VAX_SHMPARAM_H ! /* address range for shared memory attaches if no address passed to shmat() */ ! #define SHM_RANGE_START 0x50000000 ! #define SHM_RANGE_END 0x60000000 ! /* ! * Format of a swap-entry for shared memory pages currently out in ! * swap space (see also mm/swap.c). ! * ! * SWP_TYPE = SHM_SWP_TYPE ! * SWP_OFFSET is used as follows: ! * ! * bits 0..6 : id of shared memory segment page belongs to (SHM_ID) ! * bits 7..21: index of page within shared memory segment (SHM_IDX) ! * (actually fewer bits get used since SHMMAX is so low) ! */ ! /* ! * Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and ! * there is a static array of size SHMMNI. ! */ ! #define _SHM_ID_BITS 7 ! #define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1) ! ! #define SHM_IDX_SHIFT (_SHM_ID_BITS) ! #define _SHM_IDX_BITS 15 ! #define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1) ! ! /* ! * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and ! * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS). ! */ ! ! #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ ! /* Try not to change the default shipped SHMMAX - people rely on it */ ! ! #define SHMMIN 1 /* really PAGE_SIZE */ /* min shared seg size (bytes) */ ! #define SHMMNI (1<<_SHM_ID_BITS) /* max num of segs system wide */ ! #define SHMALL /* max shm system wide (pages) */ \ ! (1<<(_SHM_IDX_BITS+_SHM_ID_BITS)) ! #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ ! #define SHMSEG SHMMNI /* max shared segs per process */ ! ! #endif /* _VAX_SHMPARAM_H */ --- 1,8 ---- ! #ifndef __ASM_VAX_SHMPARAM_H ! #define __ASM_VAX_SHMPARAM_H ! /* atp jan 2001 - 2.4 merge */ ! #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ ! #endif /* _ASM_VAX_SHMPARAM_H */ Index: system.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/system.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** system.h 2001/01/17 16:18:52 1.1 --- system.h 2001/01/18 15:52:28 1.2 *************** *** 2,9 **** --- 2,16 ---- #define _VAX_SYSTEM_H + #include <linux/config.h> + #include <asm/page.h> #include <asm/mtpr.h> #include <linux/kernel.h> + + /* any preparation needed before a context switch ? */ + #define prepare_to_switch() do { } while(0) + + /* FIXME: process context switch */ Index: termios.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/termios.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** termios.h 2001/01/17 16:18:52 1.1 --- termios.h 2001/01/18 15:52:28 1.2 *************** *** 3,6 **** --- 3,8 ---- /* from asm-i386 */ + /* atp jan 2001. updated for 2.4 merge. */ + #include <asm/termbits.h> #include <asm/ioctls.h> *************** *** 37,40 **** --- 39,43 ---- #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 + #define TIOCM_LOOP 0x8000 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ *************** *** 52,55 **** --- 55,61 ---- #define N_R3964 9 /* Reserved for Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Da...@mv...> */ + #define N_IRDA 11 /* Linux IR - http://www.cs.uit.no/~dagb/irda/irda.html */ + #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ + #define N_HDLC 13 /* synchronous HDLC */ #ifdef __KERNEL__ |