|
From: Andy P. <at...@us...> - 2001-01-18 15:52:27
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/junk
In directory usw-pr-cvs1:/tmp/cvs-serv5429/include/asm-vax/junk
Added Files:
io.h.vax2.2 resource.h.vax2.2 shmparam.h.vax2.2
Log Message:
Updates to adapt code base from 2.2 to 2.4 tree. Sync up to atp 2.4 tree.
--- NEW FILE ---
#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.
*/
#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
#define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
#define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
#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 */
--- NEW FILE ---
#ifndef _VAX_RESOURCE_H
#define _VAX_RESOURCE_H
/*
* Resource limits
* FIXME: taken from alpha port. check this. atp 1998
*/
#define RLIMIT_CPU 0 /* CPU time in ms */
#define RLIMIT_FSIZE 1 /* Maximum filesize */
#define RLIMIT_DATA 2 /* max data size */
#define RLIMIT_STACK 3 /* max stack size */
#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 */
--- NEW FILE ---
#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 */
|