|
Message
From: cvs at opencores.org<cvs@o...>
Date: Tue Dec 20 12:35:45 CET 2005
Subject: [cvs-checkins] MODIFIED: or1k ...
Date: 00/05/12 20:12:35 Added: or1k/rc203soc/sw/uClinux/include/asm-i960 a.out.h atomic.h bitops.h bugs.h byteorder.h cachectl.h checksum.h delay.h dma.h dprintk.h elf.h errno.h fcntl.h flat.h font.h i960.h i960jx.h io.h ioctl.h ioctls.h irq.h machdep.h mman.h mmu_context.h mon960.h page.h param.h pgtable.h posix_types.h processor.h ptrace-kma.h ptrace.h resource.h segment.h semaphore.h setup.h shm.h shmparam.h sigcontext.h signal.h socket.h sockios.h stat.h statfs.h string.h system.h termbits.h termios.h traps-kma.h traps.h types.h unaligned.h unistd.h user.h Log: First Import of RC20x uClinux Revision Changes Path 1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/a.out.h http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/a.out.h?rev=1.1&content-type=text/x-cvsweb-markup Index: a.out.h =================================================================== #ifndef __I960_A_OUT_H__ #define __I960_A_OUT_H__ struct exec { unsigned long a_info; /* Use macros N_MAGIC, etc for access */ unsigned a_text; /* length of text, in bytes */ unsigned a_data; /* length of data, in bytes */ unsigned a_bss; /* length of uninitialized data area for file, in bytes */ unsigned a_syms; /* length of symbol table data in file, in bytes */ unsigned a_entry; /* start address */ unsigned a_trsize; /* length of relocation info for text, in bytes */ unsigned a_drsize; /* length of relocation info for data, in bytes */ }; #define N_TRSIZE(a) ((a).a_trsize) #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) #ifdef __KERNEL__ #define STACK_TOP TASK_SIZE #endif #endif /* __I960_A_OUT_H__ */ 1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/atomic.h http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/atomic.h?rev=1.1&content-type=text/x-cvsweb-markup Index: atomic.h =================================================================== #ifndef __ARCH_I960_ATOMIC__ #define __ARCH_I960_ATOMIC__ /* * Atomic operations that C can't guarantee us. Useful for * resource counting etc.. */ typedef long atomic_t; static __inline__ atomic_t atomic_add(atomic_t i, atomic_t *v) { atomic_t r; __asm__ __volatile__("atadd %3, %2, %1" : "=m" (*v), "=d" (r) : "dI" (i), "d" (v), "m"(*v)); return r; } static __inline__ atomic_t atomic_sub(atomic_t i, atomic_t *v) { atomic_t tmp, retval; __asm__ __volatile__("subo %4, 0, %2\n\t" "atadd %5, %6, %1\n\t" : "=m"(*v), "=d" (retval), "=d" (tmp) : "m" (*v), "dI" (i), "d" (v), "2" (tmp)); return retval; } static __inline__ atomic_t atomic_inc(atomic_t *v) { atomic_t retval; __asm__ __volatile__("atadd %2, 1, %1" : "=m"(*v), "=d"(retval) : "d" (v), "m"(*v)); return retval; } static __inline__ atomic_t atomic_dec(atomic_t *v) { return(atomic_add(-1, v)); } static __inline__ atomic_t atomic_dec_and_test(atomic_t *v)
{
return atomic_dec(v) == 1;
}
#endif /* __ARCH_I960_ATOMIC __ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/bitops.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/bitops.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: bitops.h
===================================================================
#ifndef _ASM_GENERIC_BITOPS_H_
#define _ASM_GENERIC_BITOPS_H_
#include <asm/system.h>
/*
* N.B.: we shouldn't assume addresses are long*'s; nr can be > 31.
*/
static __inline__ long set_bit(long nr, void *a)
{
long* addr = a;
int mask, oldval;
addr += nr >> 5;
mask = 1 << (nr & 0x1f);
__asm__ __volatile__
("atmod %3, %2, %2"
: "=m" (*addr), "=r" (oldval)
: "1" (mask), "r" (addr), "m"(*addr));
return (oldval & mask) != 0;
}
static __inline__ long clear_bit(long nr, void *a)
{
long* addr = a;
int mask, oldval;
addr += nr >> 5;
mask = 1 << (nr & 0x1f);
__asm__ __volatile__
("atmod %4, %3, %2"
: "=m" (*addr), "=r"(oldval)
: "1" (0), "r" (mask), "r"(addr), "m"(*addr));
return (oldval & mask) != 0;
}
static __inline__ long change_bit(long nr, void *a)
{
long* addr = a;
long flags;
int bitpos, retval;
addr += nr >> 5;
bitpos = (nr & 0x1f);
save_flags(flags);
cli();
#if 1
retval = (*addr & (1 << bitpos));
*addr ^= (1 << bitpos);
#else
__asm__
("ld (%2), r3\n\t"
"notbit %1, r3, r4\n\t"
"st r4, (%2)\n\t"
"ldconst 1, r4\n\t"
"shlo %1, r4, r4\n\t"
"and r4, r3, %0\n\t"
: "=&r" (retval)
: "r" (bitpos), "r" (addr)
: "r3", "r4", "memory");
#endif
restore_flags(flags);
return retval != 0;
}
static __inline__ long test_bit(long nr, void *a)
{
int * addr = a;
int mask;
addr += nr >> 5;
mask = 1 << (nr & 0x1f);
return ((mask & *addr) != 0);
}
/* The easy/cheese version for now. */
extern __inline__ unsigned long ffz(unsigned long word)
{
unsigned long result = 0;
while(word & 1) {
result++;
word >>= 1;
}
return result;
}
/* find_next_zero_bit() finds the first zero bit in a bit string of length
* 'size' bits, starting the search at bit 'offset'. This is largely based
* on Linus's ALPHA routines, which are pretty portable BTW.
*/
extern __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
if (offset >= size)
return size;
size -= result;
offset &= 31UL;
if (offset) {
tmp = *(p++);
tmp |= ~0UL >> (32-offset);
if (size < 32)
goto found_first;
if (~tmp)
goto found_middle;
size -= 32;
result += 32;
}
while (size & ~31UL) {
if (~(tmp = *(p++)))
goto found_middle;
result += 32;
size -= 32;
}
if (!size)
return result;
tmp = *p;
found_first:
tmp |= ~0UL >> size;
found_middle:
return result + ffz(tmp);
}
/* Linus sez that gcc can optimize the following correctly, we'll see if this
* holds on the Sparc as it does for the ALPHA.
*/
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
#endif /* _ASM_I960_BITOPS_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/bugs.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/bugs.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: bugs.h
===================================================================
/*
* include/asm-i960/bugs.h
*
* Copyright (C) 1999 Erik Walthinsen (omega@c...
*/
/*
* This is included by init/main.c to check for architecture-dependent bugs.
*
* Needs:
* void check_bugs(void);
*/
static void check_bugs(void)
{
}
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/byteorder.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/byteorder.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: byteorder.h
===================================================================
#ifndef _I960_BYTEORDER_H
#define _I960_BYTEORDER_H
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN 1234
#endif
#ifndef __LITTLE_ENDIAN_BITFIELD
#define __LITTLE_ENDIAN_BITFIELD
#endif
#undef ntohl
#undef ntohs
#undef htonl
#undef htons
extern unsigned long int ntohl(unsigned long int);
extern unsigned short int ntohs(unsigned short int);
extern unsigned long int htonl(unsigned long int);
extern unsigned short int htons(unsigned short int);
extern __inline__ unsigned long int __ntohl(unsigned long int);
extern __inline__ unsigned short int __ntohs(unsigned short int);
extern __inline__ unsigned long int __ntohl(unsigned long int x)
{
__asm__("bswap %1, %0"
:"=r"(x)
:"0"(x));
return x;
}
extern __inline__ unsigned short int __ntohs(unsigned short int x)
{
register unsigned long lx = x << 16;
__asm__("bswap %0, %0"
:"=r"(lx)
: "0"(lx));
return (short) lx&0xffff;
}
#define __htonl(x) __ntohl(x)
#define __htons(x) __ntohs(x)
#define ntohl(x) __ntohl(x)
#define ntohs(x) __ntohs(x)
#define htonl(x) __htonl(x)
#define htons(x) __htons(x)
#endif /* _I960_BYTEORDER_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/cachectl.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/cachectl.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: cachectl.h
===================================================================
/*
* FILE: cachectl.h
* AUTHOR: kma
* DESCR: cache defs
*/
#ifndef CACHECTL_H
#define CACHECTL_H
#ident "$Id: cachectl.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $"
#define ICACHE 1
#define DCACHE 2
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/checksum.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/checksum.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: checksum.h
===================================================================
#ifndef _I960_CHECKSUM_H
#define _I960_CHECKSUM_H
/*
* computes the checksum of a memory block at buff, length len,
* and adds in "sum" (32-bit)
*
* returns a 32-bit number suitable for feeding into itself
* or csum_tcpudp_magic
*
* this function must be called with even lengths, except
* for the last fragment, which may be odd
*
* it's best to have buff aligned on a 32-bit boundary
*/
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
/*
* the same as csum_partial_copy, but copies from src while it
* checksums
*
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
/*
* the same as csum_partial_copy, but copies from user space.
*
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
unsigned int csum_partial_copy_fromuser(const char *src, char *dst, int len, int sum);
unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
static inline unsigned short from32to16(unsigned long sum)
{
unsigned long tmp;
asm("addo %2, %3, %0
shro 16, %0, %1
clrbit 16, %0, %0
addo %0, %1, %0"
: "=&r" (sum), "=r"(tmp)
: "r"(sum & 0xffff), "r"(sum >> 16), "0"(sum));
return sum;
}
/*
* Fold a partial checksum
*/
static inline unsigned int csum_fold(unsigned int sum)
{
#if 1
return ~from32to16(sum);
#else
sum = (sum & 0xffff) + (sum >> 16); /* add top and bottom */
sum = (sum & 0xffff) + (sum >> 16); /* add carries from previous */
return ~sum;
#endif
}
/*
* computes the checksum of the TCP/UDP pseudo-header
* returns a 16-bit checksum, already complemented
*/
static inline unsigned short
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned short proto, unsigned int sum)
{
#if 0
register unsigned long lenproto = ((ntohs(len)<<16) + proto * 256);
sum += saddr;
sum += daddr + (saddr > sum);
sum += lenproto + (daddr > sum);
sum += (lenproto > sum);
#else
asm("cmpo 1, 0
addc %1, %2, %0
addc %1, %3, %0
addc %1, %4, %0
addc 0, %1, %0"
: "=&r"(sum)
: "0"(sum), "r"(saddr), "r"(daddr),
"r"((ntohs(len)<<16) + proto * 256));
#endif
return csum_fold(sum);
}
/*
* this routine is used for miscellaneous IP-like checksums, mainly
* in icmp.c
*/
extern unsigned short
ip_compute_csum(const unsigned char * buff, int len);
#endif /* _I960_CHECKSUM_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/delay.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/delay.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: delay.h
===================================================================
#ifndef _I960_DELAY_H
#define _I960_DELAY_H
extern unsigned long loops_per_sec;
#include <linux/kernel.h>
#include <linux/config.h>
/*
* Copyright (C) 1995 Erik Walthinsen (omega@c...)
*
* Delay routines, using a pre-computed "loops_per_second" value.
*/
extern __inline__ void __delay(unsigned long loops)
{
while (loops--);
}
/*
* Use only for very small delays ( < 1 msec). Should probably use a
* lookup table, really, as the multiplications take much too long with
* short delays. This is a "reasonable" implementation, though (and the
* first constant multiplications gets optimized away if the delay is
* a constant)
*/
extern __inline__ void udelay(unsigned long usecs)
{
usecs *= loops_per_sec;
usecs /= 1000000;
__delay(usecs);
}
#define muldiv(a, b, c) (((a)*(b))/(c))
#endif /* defined(_I960_DELAY_H) */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/dma.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/dma.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: dma.h
===================================================================
#ifndef _I960_DMA_H
#define _I960_DMA_H
/* Don't define MAX_DMA_ADDRESS; it's useless on the i960 and any
occurrence should be flagged as an error. */
/* the VH has 2 DMA channels, the Cx has 4 */
#define MAX_DMA_CHANNELS 4
extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
#endif /* _I960_DMA_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/dprintk.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/dprintk.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: dprintk.h
===================================================================
/*
* FILE: dprintk.h
* AUTHOR: kma
* DESCR:
*/
#ifndef DPRINTK_H
#define DPRINTK_H
#ident "$Id: dprintk.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $"
#ifdef DEBUG
#define dprintk(fmt,x...) do { printk(fmt, ## x); } while(0)
#else
#define dprintk(fmt,x...) do { } while(0)
#endif
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/elf.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/elf.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: elf.h
===================================================================
#ifndef __ASMi960_ELF_H
#define __ASMi960_ELF_H
/* FIXME very not complete... */
/* Umm, we're not planning on supporting elf binaries anyway, right? */
/*
* ELF register definitions..
*/
#include <asm/ptrace.h>
typedef unsigned long elf_greg_t;
#define ELF_NGREG 16 /* FIXME 16 local? */
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef struct user_i960fp_struct elf_fpregset_t;
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) ((x) == EM_68K)
/*
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB;
/* FIXME this isn't defined anywhere!!! HELP! */
/*#define ELF_ARCH EM_68K*/
/* For SVR4/m68k the function pointer to be registered with
`atexit' is passed in %a1. Although my copy of the ABI has
no such statement, it is actually used on ASV. */
/* FIXME huh? */
/*#define ELF_PLAT_INIT(_r) _r->a1 = 0*/
#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096
/* FIXME huh? */
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
/* Bleech. */ \
pr_reg[0] = regs->d1; \
pr_reg[1] = regs->d2; \
pr_reg[2] = regs->d3; \
pr_reg[3] = regs->d4; \
pr_reg[4] = regs->d5; \
pr_reg[7] = regs->a0; \
pr_reg[8] = regs->a1; \
pr_reg[14] = regs->d0; \
pr_reg[15] = rdusp(); \
pr_reg[16] = 0; /* orig_d0 */ \
pr_reg[17] = regs->sr; \
pr_reg[18] = regs->pc; \
{ \
struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
pr_reg[5] = sw->d6; \
pr_reg[6] = sw->d7; \
pr_reg[9] = sw->a2; \
pr_reg[10] = sw->a3; \
pr_reg[11] = sw->a4; \
pr_reg[12] = sw->a5; \
pr_reg[13] = sw->a6; \
}
#endif /* __ASMi960_ELF_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/errno.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/errno.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: errno.h
===================================================================
#ifndef _I960_ERRNO_H
#define _I960_ERRNO_H
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Arg list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE 34 /* Math result not representable */
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
#define ENOSYS 38 /* Function not implemented */
#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG 44 /* Channel number out of range */
#define EL2NSYNC 45 /* Level 2 not synchronized */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */
#define EUNATCH 49 /* Protocol driver not attached */
#define ENOCSI 50 /* No CSI structure available */
#define EL2HLT 51 /* Level 2 halted */
#define EBADE 52 /* Invalid exchange */
#define EBADR 53 /* Invalid request descriptor */
#define EXFULL 54 /* Exchange full */
#define ENOANO 55 /* No anode */
#define EBADRQC 56 /* Invalid request code */
#define EBADSLT 57 /* Invalid slot */
#define EDEADLOCK EDEADLK
#define EBFONT 59 /* Bad font file format */
#define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data available */
#define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */
#define ENONET 64 /* Machine is not on the network */
#define ENOPKG 65 /* Package not installed */
#define EREMOTE 66 /* Object is remote */
#define ENOLINK 67 /* Link has been severed */
#define EADV 68 /* Advertise error */
#define ESRMNT 69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
#define EREMCHG 78 /* Remote address changed */
#define ELIBACC 79 /* Can not access a needed shared library */
#define ELIBBAD 80 /* Accessing a corrupted shared library */
#define ELIBSCN 81 /* .lib section in a.out corrupted */
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
#define EILSEQ 84 /* Illegal byte sequence */
#define ERESTART 85 /* Interrupted system call should be restarted */
#define ESTRPIPE 86 /* Streams pipe error */
#define EUSERS 87 /* Too many users */
#define ENOTSOCK 88 /* Socket operation on non-socket */
#define EDESTADDRREQ 89 /* Destination address required */
#define EMSGSIZE 90 /* Message too long */
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
#define ENOPROTOOPT 92 /* Protocol not available */
#define EPROTONOSUPPORT 93 /* Protocol not supported */
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define EADDRINUSE 98 /* Address already in use */
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
#define ENETDOWN 100 /* Network is down */
#define ENETUNREACH 101 /* Network is unreachable */
#define ENETRESET 102 /* Network dropped connection because of reset */
#define ECONNABORTED 103 /* Software caused connection abort */
#define ECONNRESET 104 /* Connection reset by peer */
#define ENOBUFS 105 /* No buffer space available */
#define EISCONN 106 /* Transport endpoint is already connected */
#define ENOTCONN 107 /* Transport endpoint is not connected */
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
#define ETIMEDOUT 110 /* Connection timed out */
#define ECONNREFUSED 111 /* Connection refused */
#define EHOSTDOWN 112 /* Host is down */
#define EHOSTUNREACH 113 /* No route to host */
#define EALREADY 114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale NFS file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
#define EREMOTEIO 121 /* Remote I/O error */
#define EDQUOT 122 /* Quota exceeded */
#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#endif /* _I960_ERRNO_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/fcntl.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/fcntl.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: fcntl.h
===================================================================
#ifndef _I960_FCNTL_H
#define _I960_FCNTL_H
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
#define O_TRUNC 01000 /* not fcntl */
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_NDELAY O_NONBLOCK
#define O_SYNC 010000
#define FASYNC 020000 /* fcntl, for BSD compatibility */
#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get f_flags */
#define F_SETFD 2 /* set f_flags */
#define F_GETFL 3 /* more flags (cloexec) */
#define F_SETFL 4
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */
struct flock {
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
#endif /* _I960_FCNTL_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/flat.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/flat.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: flat.h
===================================================================
/* Copyright (C) 1998 Kenneth Albanowski <kjahds@k...>
* The Silver Hammer Group, Ltd.
*
*/
#ifndef _LINUX_FLAT_H
#define _LINUX_FLAT_H
struct flat_hdr {
char magic[4];
unsigned long rev;
unsigned long entry; /* Offset of first executable instruction with text segment from beginning of file*/
unsigned long data_start; /* Offset of data segment from beginning of file*/
unsigned long data_end; /* Offset of end of data segment from beginning of file*/
unsigned long bss_end; /* Offset of end of bss segment from beginning of file*/
/* (It is assumed that data_end through bss_end forms the
bss segment.) */
unsigned long stack_size; /* Size of stack, in bytes */
unsigned long reloc_start; /* Offset of relocation records from beginning of file */
unsigned long reloc_count; /* Number of relocation records */
unsigned long flags;
unsigned long filler[6]; /* Reservered, set to zero */
};
#define FLAT_RELOC_TYPE_TEXT 0
#define FLAT_RELOC_TYPE_DATA 1
#define FLAT_RELOC_TYPE_BSS 2
struct flat_reloc {
unsigned long value;
};
#define FR_TEXTBIT ( 1 << 31 )
#define FR_TEXT(rel) ((rel) & FR_TEXTBIT)
#define FR_OFFSET(rel) (((rel) & ~FR_TEXTBIT) >> 2)
#define FR_TYPE(rel) ((rel) & 3)
#define FLAT_FLAG_RAM 0x0001 /* program should be loaded entirely into RAM */
#endif /* _LINUX_FLAT_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/font.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/font.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: font.h
===================================================================
/*
* asm-i960/font.h -- `Soft' font definitions
*
* Created 1995 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#ifndef _ASM_I960_FONT_H_
#define _ASM_I960_FONT_H_
#include <linux/types.h>
/*
* Find a font with a specific name
*/
extern int findsoftfont(char *name, int *width, int *height, u_char *data[]);
/*
* Get the default font for a specific screen size
*/
extern void getdefaultfont(int xres, int yres, char *name[], int *width,
int *height, u_char *data[]);
/* Max. length for the name of a predefined font */
#define MAX_FONT_NAME 32
#endif /* _ASM_I960_FONT_H_ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/i960.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/i960.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: i960.h
===================================================================
/*
* FILE: i960.h
* AUTHOR: kma
* DESCR: generic definitions of i960 data structures
*/
#ifndef I960_H
#define I960_H
#ident "$Id: i960.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $"
#ifdef __ASSEMBLY__
/*
* register saving/restoring code. used by both syscall and interrupt handlers
*/
#define current SYMBOL_NAME(current_set)
#define SAVE_ALL(freereg) \
ldconst 64, freereg; \
addo freereg, sp, sp; \
stq g0, -64(sp); \
stq g4, -48(sp); \
stq g8, -32(sp); \
stq g12, -16(sp)
#define RESTORE_ALL(freereg) \
ldq -16(sp), g12; \
ldq -32(sp), g8; \
ldq -48(sp), g4; \
ldq -64(sp), g0; \
ldconst 64, freereg; \
subo freereg, sp, sp
#else
typedef unsigned long reg_t;
static inline unsigned long get_ipl(void)
{
unsigned long retval;
__asm__ __volatile__("modpc 0, 0, %0" : "=r" (retval));
return ( (retval >> 16) & 0x1f);
}
static inline unsigned long get_pc(void)
{
unsigned long retval;
__asm__ __volatile__("modpc 0, 0, %0" : "=r" (retval));
return retval;
}
/*
* Interrupt record. Every interrupt handler has one located at fp-16.
* We'll ultimately use the saved PC to determine whether we interrupted
* supervisor or user mode.
*/
typedef struct {
reg_t ir_pc;
reg_t ir_ac;
unsigned char ir_vec; /* vector number of interrupt; only low-order
byte is meaningful */
} irec_t;
typedef void(*isr_t)(irec_t*);
typedef struct {
reg_t i_pending_pris; /* priorities w/ pending intrs */
reg_t i_pending_ints[8]; /* pending interrupts */
isr_t i_vectors[248]; /* pointers to handlers */
} itab_t;
#endif
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/i960jx.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/i960jx.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: i960jx.h
===================================================================
#ifndef _I960JX_H
#define _I960JX_H
#include <asm/i960.h>
/* Default Logical Memory Configuration Register */
#define DLMCON 0xFF008100
/* Logical Memory Address/Mask Registers */
#define LMADR0 0xFF008108
#define LMMR0 0xFF00810C
#define LMADR1 0xFF008110
#define LMMR1 0xFF008114
/* Instruction Breakpoint Registers */
#define IPB0 0xFF008400
#define IPB1 0xFF008404
/* Data Address Breakpoint Registers */
#define DAB0 0xFF008420
#define DAB1 0xFF008424
/* Breakpoint Control Register */
#define BPCON 0xFF008440
/* Interrupt Mask - IMSK and Interrupt Pending Registers - -IPND */
#define IPND 0xFF008500
#define IMSK 0xFF008504
/* Interrupt Control Register */
#define ICON 0xFF008510
/* Interrupt Mapping Registers */
#define IMAP0 0xFF008520
#define IMAP1 0xFF008524
#define IMAP2 0xFF008528
/* Physical Memory Control Registers */
#define PMCON0_1 0xFF008600
#define PMCON2_3 0xFF008608
#define PMCON4_5 0xFF008610
#define PMCON6_7 0xFF008618
#define PMCON8_9 0xFF008620
#define PMCON10_11 0xFF008628
#define PMCON12_13 0xFF008630
#define PMCON14_15 0xFF008638
/* Bus Control Register */
#define BCON 0xFF0086FC
/* Initial PRCB address; might be changed by calls to sysctl */
#define INITIAL_PRCB 0xFF008700
#ifndef __ASSEMBLY__
/* PRCB */
typedef struct {
void* pr_fault_tab; /* fault handlers */
void* pr_ctl_tab; /* control table */
reg_t pr_acreg; /* AC reg initial image */
reg_t pr_fault_cw; /* fault config word */
itab_t* pr_intr_tab; /* interrupt handlers */
void* pr_syscall_tab; /* system calls */
void* pr_reserved; /* unused */
void* pr_intr_stack; /* interrupt stack */
reg_t pr_icache_cw; /* icache config word */
reg_t pr_regcache_cw; /* register cache config word */
} prcb_t;
#endif /* __ASSEMBLY__ */
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/io.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/io.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: io.h
===================================================================
#ifndef _I960_IO_H
#define _I960_IO_H
/*
* readX/writeX() are used to access I/O space-- the address space the PCI
* speaks in. On the i960 architecture, some PCI addresses can be translated
* by the atu directly, and some cannot. These functions are non-trivial.
*/
extern unsigned char readb(char* addr);
extern unsigned short readw(char* addr);
extern unsigned int readl(char* addr);
extern unsigned char writeb(unsigned char val, char* addr);
extern unsigned short writew(unsigned short val, char* addr);
extern unsigned int writel(unsigned int val, char* addr);
#define outb_p writeb
#define outb writeb
#define outw writew
#define outl writel
#define inb_p readb
#define inb readb
#define inw readw
#define inl readl
/*
* Change virtual addresses to physical addresses and vv.
* These are trivial on the 1:1 Linux/i386 mapping (but if we ever
* make the kernel segment mapped at 0, we need to do translation
* on the i386 as well)
*/
extern unsigned long mm_vtop(unsigned long addr);
extern unsigned long mm_ptov(unsigned long addr);
extern inline unsigned long virt_to_phys(volatile void * address)
{
return (unsigned long) mm_vtop((unsigned long)address);
}
extern inline void * phys_to_virt(unsigned long address)
{
return (void *) mm_ptov(address);
}
/*
* IO bus memory addresses are also 1:1 with the physical address
* XXX: umm, not really
*/
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
#endif /* _I960_IO_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/ioctl.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/ioctl.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: ioctl.h
===================================================================
/* $Id: ioctl.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $
*
* linux/ioctl.h for Linux by H.H. Bergman.
*/
#ifndef _I960_IOCTL_H
#define _I960_IOCTL_H
/* ioctl command encoding: 32 bits total, command in lower 16 bits,
* size of the parameter structure in the lower 14 bits of the
* upper 16 bits.
* Encoding the size of the parameter structure in the ioctl request
* is useful for catching programs compiled with old versions
* and to avoid overwriting user space outside the user buffer area.
* The highest 2 bits are reserved for indicating the ``access mode''.
* NOTE: This limits the max parameter size to 16kB -1 !
*/
/*
* I don't really have any idea about what this should look like, so
* for the time being, this is heavily based on the PC definitions.
*/
/*
* The following is for compatibility across the various Linux
* platforms. The i386 ioctl numbering scheme doesn't really enforce
* a type field. De facto, however, the top 8 bits of the lower 16
* bits are indeed used as a type field, so we might just as well make
* this explicit here. Please be sure to use the decoding macros
* below from now on.
*/
#define _IOC_NRBITS 8
#define _IOC_TYPEBITS 8
#define _IOC_SIZEBITS 14
#define _IOC_DIRBITS 2
#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
#define _IOC_NRSHIFT 0
#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
/*
* Direction bits.
*/
#define _IOC_NONE 0U
#define _IOC_WRITE 1U
#define _IOC_READ 2U
#define _IOC(dir,type,nr,size) \
(((dir) << _IOC_DIRSHIFT) | \
((type) << _IOC_TYPESHIFT) | \
((nr) << _IOC_NRSHIFT) | \
((size) << _IOC_SIZESHIFT))
/* used to create numbers */
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
/* used to decode ioctl numbers.. */
#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
/* ...and for the drivers/sound files... */
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
#endif /* _I960_IOCTL_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/ioctls.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/ioctls.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: ioctls.h
===================================================================
#ifndef __ARCH_I960_IOCTLS_H__
#define __ARCH_I960_IOCTLS_H__
#include <asm/ioctl.h>
/* 0x54 is just a magic number to make these relatively unique ('T') */
#define TCGETS 0x5401
#define TCSETS 0x5402
#define TCSETSW 0x5403
#define TCSETSF 0x5404
#define TCGETA 0x5405
#define TCSETA 0x5406
#define TCSETAW 0x5407
#define TCSETAF 0x5408
#define TCSBRK 0x5409
#define TCXONC 0x540A
#define TCFLSH 0x540B
#define TIOCEXCL 0x540C
#define TIOCNXCL 0x540D
#define TIOCSCTTY 0x540E
#define TIOCGPGRP 0x540F
#define TIOCSPGRP 0x5410
#define TIOCOUTQ 0x5411
#define TIOCSTI 0x5412
#define TIOCGWINSZ 0x5413
#define TIOCSWINSZ 0x5414
#define TIOCMGET 0x5415
#define TIOCMBIS 0x5416
#define TIOCMBIC 0x5417
#define TIOCMSET 0x5418
#define TIOCGSOFTCAR 0x5419
#define TIOCSSOFTCAR 0x541A
#define FIONREAD 0x541B
#define TIOCINQ FIONREAD
#define TIOCLINUX 0x541C
#define TIOCCONS 0x541D
#define TIOCGSERIAL 0x541E
#define TIOCSSERIAL 0x541F
#define TIOCPKT 0x5420
#define FIONBIO 0x5421
#define TIOCNOTTY 0x5422
#define TIOCSETD 0x5423
#define TIOCGETD 0x5424
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define FIOCLEX 0x5451
#define FIOASYNC 0x5452
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
#define TIOCSERSWILD 0x5455
#define TIOCGLCKTRMIOS 0x5456
#define TIOCSLCKTRMIOS 0x5457
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
#define TIOCSERGETLSR 0x5459 /* Get line status register */
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
/* Used for packet mode */
#define TIOCPKT_DATA 0
#define TIOCPKT_FLUSHREAD 1
#define TIOCPKT_FLUSHWRITE 2
#define TIOCPKT_STOP 4
#define TIOCPKT_START 8
#define TIOCPKT_NOSTOP 16
#define TIOCPKT_DOSTOP 32
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
#endif /* __ARCH_I960_IOCTLS_H__ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/irq.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/irq.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: irq.h
===================================================================
#ifndef _I960_IRQ_H_
#define _I960_IRQ_H_
/* FIXME not touched yet */
extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);
#include <linux/config.h>
/*
* # of i960 interrupts
*/
#define SYS_IRQS 8
/*
* This should be the same as the max(NUM_X_SOURCES) for all the
* different m68k hosts compiled into the kernel.
* Currently the Atari has 72 and the Amiga 24, but if both are
* supported in the kernel it is better to make room for 72.
*/
#if defined(CONFIG_ATARI)
#define NR_IRQS (72+SYS_IRQS)
#else
#define NR_IRQS (24+SYS_IRQS)
#endif
/*
* Interrupt source definitions
* General interrupt sources are the level 1-7.
* Adding an interrupt service routine for one of these sources
* results in the addition of that routine to a chain of routines.
* Each one is called in succession. Each individual interrupt
* service routine should determine if the device associated with
* that routine requires service.
*/
#define IRQ1 (1) /* level 1 interrupt */
#define IRQ2 (2) /* level 2 interrupt */
#define IRQ3 (3) /* level 3 interrupt */
#define IRQ4 (4) /* level 4 interrupt */
#define IRQ5 (5) /* level 5 interrupt */
#define IRQ6 (6) /* level 6 interrupt */
#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
/*
* "Generic" interrupt sources
*/
#define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */
/*
* Machine specific interrupt sources.
*
* Adding an interrupt service routine for a source with this bit
* set indicates a special machine specific interrupt source.
* The machine specific files define these sources.
*/
#define IRQ_MACHSPEC (0x10000000L)
#define IRQ_IDX(irq) ((irq) & ~IRQ_MACHSPEC)
/*
* various flags for request_irq()
*/
#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
#define IRQ_FLG_FAST (0x0004)
#define IRQ_FLG_SLOW (0x0008)
#define IRQ_FLG_STD (0x8000) /* internally used */
/*
* This structure is used to chain together the ISRs for a particular
* interrupt source (if it supports chaining).
*/
typedef struct irq_node {
void (*handler)(int, void *, struct pt_regs *);
unsigned long flags;
void *dev_id;
const char *devname;
struct irq_node *next;
} irq_node_t;
/*
* This structure has only 4 elements for speed reasons
*/
typedef struct irq_handler {
void (*handler)(int, void *, struct pt_regs *);
unsigned long flags;
void *dev_id;
const char *devname;
} irq_handler_t;
/* count of spurious interrupts */
extern volatile unsigned int num_spurious;
/*
* This function returns a new irq_node_t
*/
extern irq_node_t *new_irq_node(void);
#endif /* _I960_IRQ_H_ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/machdep.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/machdep.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: machdep.h
===================================================================
#ifndef _I960_MACHDEP_H
#define _I960_MACHDEP_H
#define VULP(x) (*(volatile unsigned long*)(x))
#define VUSP(x) (*(volatile unsigned short*)(x))
#define VUCP(x) (*(volatile unsigned char*)(x))
/* FIXME unknown if these correspond to anything on the i960
#define M68K_REGBASE_328 (0xFFFF0000)
#define M68K_REG_IMR VULP(M68K_REGBASE_328 + 0xF304)
*/
struct pt_regs;
struct kbd_repeat;
struct mktime;
struct hwclk_time;
struct gendisk;
struct buffer_head;
extern void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *));
/* machine dependent keyboard functions */
extern int (*mach_keyb_init) (void);
extern int (*mach_kbdrate) (struct kbd_repeat *);
extern void (*mach_kbd_leds) (unsigned int);
/* machine dependent irq functions */
extern void (*mach_init_IRQ) (void);
extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id);
extern int (*mach_free_irq) (unsigned int irq, void *dev_id);
extern void (*mach_enable_irq) (unsigned int irq);
extern void (*mach_disable_irq) (unsigned int irq);
extern int (*mach_get_irq_list) (char *buf);
extern void (*mach_process_int) (int irq, struct pt_regs *fp);
/* machine dependent timer functions */
extern unsigned long (*mach_gettimeoffset)(void);
extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
int *min, int *sec);
extern int (*mach_hwclk)(int, struct hwclk_time*);
extern int (*mach_set_clock_mmss)(unsigned long);
extern void (*mach_mksound)( unsigned int count, unsigned int ticks );
extern void (*mach_reset)( void );
extern int (*mach_floppy_init) (void);
extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
extern void (*mach_hd_setup)(char *, int *);
extern void (*waitbut)(void);
extern struct fb_info *(*mach_fb_init)(long *);
extern long mach_max_dma_address;
extern void (*mach_debug_init)(void);
extern void (*mach_video_setup)(char *, int *);
extern void (*mach_floppy_setup)(char *, int *);
extern void (*mach_floppy_eject)(void);
#endif /* _I960_MACHDEP_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/mman.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/mman.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: mman.h
===================================================================
#ifndef __I960_MMAN_H__
#define __I960_MMAN_H__
#define PROT_READ 0x1 /* page can be read */
#define PROT_WRITE 0x2 /* page can be written */
#define PROT_EXEC 0x4 /* page can be executed */
#define PROT_NONE 0x0 /* page can not be accessed */
#define MAP_SHARED 0x01 /* Share changes */
#define MAP_PRIVATE 0x02 /* Changes are private */
#define MAP_TYPE 0x0f /* Mask for type of mapping */
#define MAP_FIXED 0x10 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x20 /* don't use a file */
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
#define MAP_EXECUTABLE 0x1000 /* mark it as a executable */
#define MAP_LOCKED 0x2000 /* pages are locked */
#define MS_ASYNC 1 /* sync memory asynchronously */
#define MS_INVALIDATE 2 /* invalidate the caches */
#define MS_SYNC 4 /* synchronous memory sync */
#define MCL_CURRENT 1 /* lock all current mappings */
#define MCL_FUTURE 2 /* lock all future mappings */
/* compatibility flags */
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FILE 0
#endif /* __I960_MMAN_H__ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/mmu_context.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/mmu_context.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: mmu_context.h
===================================================================
#ifndef _I960_MMU_CONTEXT_H
#define _I960_MMU_CONTEXT_H
/*
* get a new mmu context.. do we need this on the m68k?
*/
#define get_mmu_context(x) do { } while (0)
#endif /* _I960_MMU_CONTEXT_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/mon960.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/mon960.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: mon960.h
===================================================================
/*
* FILE: mon960.h
* AUTHOR: kma
* DESCR: mon960 calls
*/
#ifndef MON960_H
#define MON960_H
#ident "$Id: mon960.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $"
unsigned long mon_entry(void);
unsigned long get_prcbptr(void);
void mon960_exit(int val);
#ifdef CONFIG_PCI
typedef struct {
int bus;
int dev;
int fn;
} pci_dev_info;
/*
* mon960 system calls for pci management
*/
extern int mon960_pcibios_present(void* info);
extern int mon960_pcibios_find_device(int vendor, int dev, int idx, void* loc);
extern int mon960_pcibios_find_class(int class, int idx, void* dev);
#define MON960_BIOS_DECL(op,sz,type) \
extern int \
mon960_pcibios_ ## op ## _config_ ##sz(unsigned short vec, \
unsigned short dev, \
unsigned short func, \
unsigned char off, \
type val);
MON960_BIOS_DECL(read,byte,unsigned char*);
MON960_BIOS_DECL(read,word,unsigned short*);
MON960_BIOS_DECL(read,dword,unsigned int*);
MON960_BIOS_DECL(write,byte,unsigned char);
MON960_BIOS_DECL(write,word,unsigned short);
MON960_BIOS_DECL(write,dword,unsigned int);
#undef MON960_BIOS_DECL
#endif /* CONFIG_PCI */
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/page.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/page.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: page.h
===================================================================
#ifndef _I960_PAGE_H
#define _I960_PAGE_H
#include <linux/config.h>
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__
#define STRICT_MM_TYPECHECKS
#ifdef STRICT_MM_TYPECHECKS
/*
* These are used to make use of C type-checking..
*/
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd[16]; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte)
#define pmd_val(x) ((&x)->pmd[0])
#define pgd_val(x) ((x).pgd)
#define pgprot_val(x) ((x).pgprot)
#define __pte(x) ((pte_t) { (x) } )
#define __pmd(x) ((pmd_t) { (x) } )
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )
#else
/*
* .. while these make it easier on the compiler
*/
typedef unsigned long pte_t;
typedef struct { unsigned long pmd[16]; } pmd_t;
typedef unsigned long pgd_t;
typedef unsigned long pgprot_t;
#define pte_val(x) (x)
#define pmd_val(x) ((&x)->pmd[0])
#define pgd_val(x) (x)
#define pgprot_val(x) (x)
#define __pte(x) (x)
#define __pmd(x) ((pmd_t) { (x) } )
#define __pgd(x) (x)
#define __pgprot(x) (x)
#endif
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
/* This handles the memory map.. */
/* FIXME this should be a I960-specific value set in an arch.h file */
#define PAGE_OFFSET 0xA3C00000
#define MAP_NR(addr) ((((unsigned long)(addr)) - PAGE_OFFSET) >> PAGE_SHIFT)
#endif /* __KERNEL__ */
#endif /* _I960_PAGE_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/param.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/param.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: param.h
===================================================================
#ifndef _I960_PARAM_H
#define _I960_PARAM_H
#include <linux/config.h>
/* this is not quite arbitrary; it needs to be longer than the longest path
* through schedule() */
#ifndef HZ
#define HZ 100
#endif
#define EXEC_PAGESIZE 4096
#ifndef NGROUPS
#define NGROUPS 32
#endif
#ifndef NOGROUP
#define NOGROUP (-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
#endif /* _I960_PARAM_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/pgtable.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/pgtable.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: pgtable.h
===================================================================
#ifndef _I960_PGTABLE_H
#define _I960_PGTABLE_H
extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const));
extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
#define VTOP(addr) (mm_vtop((unsigned long)(addr)))
#define PTOV(addr) (mm_ptov((unsigned long)(addr)))
extern inline void flush_cache_mm(struct mm_struct *mm)
{
}
extern inline void flush_cache_range(struct mm_struct *mm,
unsigned long start,
unsigned long end)
{
}
/* Push the page at kernel virtual address and clear the icache */
extern inline void flush_page_to_ram (unsigned long address)
{
}
/* Push n pages at kernel virtual address and clear the icache */
extern inline void flush_pages_to_ram (unsigned long address, int n)
{
}
#endif /* _I960_PGTABLE_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/posix_types.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/posix_types.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: posix_types.h
===================================================================
#ifndef __ARCH_I960_POSIX_TYPES_H
#define __ARCH_I960_POSIX_TYPES_H
/*
* This file is generally used by user-level software, so you need to
* be a little careful about namespace pollution etc. Also, we cannot
* assume GCC is being used.
*/
/* for i960, set all int's to short's, since m68k int is 2 bytes */
typedef unsigned short __kernel_dev_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_nlink_t;
typedef long __kernel_off_t;
typedef short __kernel_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef unsigned long __kernel_size_t;
typedef short __kernel_ssize_t;
typedef short __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_clock_t;
typedef short __kernel_daddr_t;
typedef char * __kernel_caddr_t;
#ifdef __GNUC__
typedef long long __kernel_loff_t;
#endif
typedef struct {
#if defined(__KERNEL__) || defined(__USE_ALL)
int val[2];
#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
int __val[2];
#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
} __kernel_fsid_t;
#undef __FD_SET
#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
#undef __FD_CLR
#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
#undef __FD_ISSET
#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
#undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
#endif /* __ARCH_I960_POSIX_TYPES_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/processor.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/processor.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: processor.h
===================================================================
/*
* include/asm-i960/processor.h
*
* Copyright (C) 1999 Keith Adams
*/
#ifndef __ASM_I960_PROCESSOR_H
#define __ASM_I960_PROCESSOR_H
#include <asm/segment.h>
/*
* Bus types
*/
#define EISA_bus__is_a_macro 1
#define EISA_bus 0
#define MCA_bus__is_a_macro 1
#define MCA_bus 0
/*
* The i960 can't do write protection
*/
#define wp_works_ok__is_a_macro 1
#define wp_works_ok 0
/* MAX floating point unit state size (FSAVE/FRESTORE) */
#define FPSTATESIZE 0
struct thread_struct {
unsigned long pfp; /* saved pfp of thread */
};
/* XXX: do something with this */
#define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
#define INIT_TSS { \
(long) init_kernel_stack, 0, \
0 \
}
unsigned long alloc_kernel_stack(void);
void free_kernel_stack(unsigned long ksp);
/*
* Do necessary setup to start up a newly executed thread.
*/
struct i960_frame {
unsigned long pfp;
unsigned long sp;
unsigned long rip;
};
extern void start_thread(struct pt_regs * regs,
unsigned long ip,
unsigned long sp);
/* TODO: tracing stuff */
static inline void tron(void)
{
}
static inline void troncof(void)
{
}
static inline void troff(void)
{
}
/*
* Return saved PC of a blocked thread.
*/
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
{
struct i960_frame* frame = (struct i960_frame*)t->pfp;
return frame->rip;
}
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/ptrace-kma.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/ptrace-kma.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: ptrace-kma.h
===================================================================
/*
* FILE: ptrace.h
* AUTHOR: kma
* DESCR:
*/
#ifndef PTRACE_H
#define PTRACE_H
#ident "$Id: ptrace-kma.h,v 1.1 2005/12/20 11:35:39 jcastillo Exp $"
/*
* Always get the AC, PC
*/
struct pt_regs {
long PC;
long AC;
};
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/ptrace.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/ptrace.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: ptrace.h
===================================================================
#ifndef _I960_PTRACE_H
#define _I960_PTRACE_H
/* this file describes the stack. While our actual stack frame contains only
* the local registers, a few words before the frame pointer we'll have the
* PC and AC, so we just consider this structure as if it were the actual
* regset. Since interrupts save the g-regs, we might as well make those
* available as well.
*/
/* 16 local registers */
#define PT_R0 0
#define PT_R1 1
#define PT_R2 2
#define PT_R3 3
#define PT_R4 4
#define PT_R5 5
#define PT_R6 6
#define PT_R7 7
#define PT_R8 8
#define PT_R9 9
#define PT_R10 10
#define PT_R11 11
#define PT_R12 12
#define PT_R13 13
#define PT_R14 14
#define PT_R15 15
/* AKAs for local registers */
#define PT_PFP 0
#define PT_SP 1
#define PT_RIP 2
#ifndef __ASSEMBLY__
/* this struct defines the way the registers are stored on the
stack during system calls and interrupts */
struct pt_regs {
/* FP - 16 */
long pc; /* processor control reg */
long ac; /* arithmetic control reg */
unsigned char vecs[4]; /* vecs[3] is irq; rest are reserved */
long reserved;
/* FP */
long lregs[16]; /* 16 local regs */
long gregs[16]; /* 16 global regs */
};
#ifdef __KERNEL__
#if 1
#define user_mode(regs) (!test_bit(1, &(regs)->pc) )
#else
/*
* Two cases: if 1st bit of pfp is set, it was a system call from user mode.
* Otherwise, if the pfp's return field is 7 (i.e., it was an interrupt) we
* can check the image of the PC. When we're in syscalls, we can't trust the
* PC image in regs...
*/
#define user_mode(regs) \
( ((regs)->lregs[PT_PFP] & 0x2) || \
(((regs)->lregs[PT_PFP] & 0x7)==0x7 && (!test_bit(1, &(regs)->pc))) )
extern void show_regs(struct pt_regs *);
#endif /* 0 */
/* get RIP out of previous frame */
#define instruction_pointer(regs) \
( ((unsigned long*)((regs)->lregs[PT_PFP]))[PT_RIP])
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
#endif /* _I960_PTRACE_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/resource.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/resource.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: resource.h
===================================================================
#ifndef _I960_RESOURCE_H
#define _I960_RESOURCE_H
/* FIXME add process(or) priority in here somewhere? */
/*
* Resource limits
*/
#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_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 RLIM_NLIMITS 10
#ifdef __KERNEL__
#define INIT_RLIMITS \
{ \
{LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX}, \
{_STK_LIM, _STK_LIM}, \
{ 0, LONG_MAX}, \
{LONG_MAX, LONG_MAX}, \
{MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, \
{NR_OPEN, NR_OPEN}, \
{LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX} \
}
#endif /* __KERNEL__ */
#endif /* _I960_RESOURCE_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/segment.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/segment.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: segment.h
===================================================================
#ifndef _I960_SEGMENT_H
#define _I960_SEGMENT_H
/* define constants */
/* Address spaces (FC0-FC2) */
#define USER_DATA (1)
#ifndef USER_DS
#define USER_DS (USER_DATA)
#endif
#define USER_PROGRAM (2)
#define SUPER_DATA (5)
#ifndef KERNEL_DS
#define KERNEL_DS (SUPER_DATA)
#endif
#define SUPER_PROGRAM (6)
#define CPU_SPACE (7)
#ifndef __ASSEMBLY__
/*
* Uh, these should become the main single-value transfer routines..
* They automatically use the right size if we just have the right
* pointer type..
*/
#define put_user(x,ptr) __put_user((unsigned long)(x),(ptr),sizeof(*(ptr)))
#define get_user(ptr) ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr))))
/*
* This is a silly but good way to make sure that
* the __put_user function is indeed always optimized,
* and that we use the correct sizes..
*/
extern int bad_user_access_length(void);
#define __ptr(x) ((unsigned long *)(x))
static inline void __put_user(unsigned long x, void * y, int size)
{
switch (size) {
case 1:
*(char*)y = x;
break;
case 2:
*(short*)y = x;
break;
case 4:
*(long*)y = x;
break;
default:
bad_user_access_length();
}
}
static inline unsigned long __get_user(const void * y, int size)
{
switch (size) {
case 1:
return *(unsigned char*) y;
case 2:
return *(unsigned short*) y;
case 4:
return *(unsigned long*) y;
default:
return bad_user_access_length();
}
}
#undef __ptr
/*
* These are deprecated..
*
* Use "put_user()" and "get_user()" with the proper pointer types instead.
*/
#define get_fs_byte(addr) __get_user((const unsigned char *)(addr),1)
#define get_fs_word(addr) __get_user((const unsigned short *)(addr),2)
#define get_fs_long(addr) __get_user((const unsigned int *)(addr),4)
#define put_fs_byte(x,addr) __put_user((x),(unsigned char *)(addr),1)
#define put_fs_word(x,addr) __put_user((x),(unsigned short *)(addr),2)
#define put_fs_long(x,addr) __put_user((x),(unsigned int *)(addr),4)
#ifdef WE_REALLY_WANT_TO_USE_A_BROKEN_INTERFACE
static inline unsigned char get_user_byte(const char * addr)
{
return __get_user(addr,1);
}
static inline unsigned short get_user_word(const short *addr)
{
return __get_user(addr,2);
}
static inline unsigned long get_user_long(const int *addr)
{
return __get_user(addr,4);
}
static inline void put_user_byte(char val,char *addr)
{
__put_user(val, addr, 1);
}
static inline void put_user_word(short val,short * addr)
{
__put_user(val, addr, 2);
}
static inline void put_user_long(unsigned long val,int * addr)
{
__put_user(val, addr, 4);
}
#endif
#include <linux/string.h>
static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n)
{
memcpy(to, from, n);
}
static inline void __constant_memcpy_tofs(void * to, const void * from, unsigned long n)
{
memcpy(to, from, n);
}
static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n)
{
memcpy(to, from, n);
}
static inline void __constant_memcpy_fromfs(void * to, const void * from, unsigned long n)
{
memcpy(to, from, n);
}
#define memcpy_fromfs(to, from, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy_fromfs((to),(from),(n)) : \
__generic_memcpy_fromfs((to),(from),(n)))
#define memcpy_tofs(to, from, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy_tofs((to),(from),(n)) : \
__generic_memcpy_tofs((to),(from),(n)))
/*
* Get/set the SFC/DFC registers for MOVES instructions
*/
static inline unsigned long get_fs(void)
{
return USER_DS;
}
static inline unsigned long get_ds(void)
{
/* return the supervisor data space code */
return KERNEL_DS;
}
static inline void set_fs(unsigned long val)
{
}
#endif /* __ASSEMBLY__ */
#endif /* _I960_SEGMENT_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/semaphore.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/semaphore.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: semaphore.h
===================================================================
#ifndef _I960_SEMAPHORE_H
#define _I960_SEMAPHORE_H
/*
* interrupt-safe (not SMP-safe) semaphores..
*
* (C) Copyright 1999 Keith Adams <kma@c...>
* Oregon Graduate Institute
*
* Based on include/asm-i386/semaphore.h:
* (C) Copyright 1996 Linus Torvalds
*
*/
#include <asm/atomic.h>
struct semaphore {
atomic_t count;
atomic_t waking;
int lock; /* we don't actually use this; sched.c needs it, tho */
struct wait_queue * wait;
};
#define MUTEX ((struct semaphore) { 1, 0, 0, NULL })
#define MUTEX_LOCKED ((struct semaphore) { 0, 0, 0, NULL })
extern void down(struct semaphore * sem);
extern int down_interruptible(struct semaphore * sem);
extern void up(struct semaphore * sem);
extern void get_buzz_lock(int *lock_ptr);
extern void give_buzz_lock(int *lock_ptr);
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/setup.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/setup.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: setup.h
===================================================================
/*
** asm/setup.h -- Definition of the Linux/m68k boot information structure
**
** Copyright 1992 by Greg Harp
**
** This file is subject to the terms and conditions of the GNU General Public
** License. See the file COPYING in the main directory of this archive
** for more details.
**
** Created 09/29/92 by Greg Harp
**
** 5/2/94 Roman Hodek:
** Added bi_atari part of the machine dependent union bi_un; for now it
** contains just a model field to distinguish between TT and Falcon.
** 26/7/96 Roman Zippel:
** Renamed to setup.h; added some useful macros to allow gcc some
** optimizations if possible.
*/
#ifndef _M68K_SETUP_H
#define _M68K_SETUP_H
#include <linux/config.h>
#define CL_SIZE (256)
#if 0
#include <asm/zorro.h>
/*
* Amiga specific part of bootinfo structure.
*/
#define NUM_AUTO 16
#ifndef __ASSEMBLY__
#define AMIGAHW_DECLARE(name) unsigned name : 1
#define AMIGAHW_SET(name) (boot_info.bi_amiga.hw_present.name = 1)
#define AMIGAHW_PRESENT(name) (boot_info.bi_amiga.hw_present.name)
struct bi_Amiga {
int model; /* Amiga Model (3000?) */
int num_autocon; /* # of autoconfig devices found */
struct ConfigDev autocon[NUM_AUTO]; /* up to 16 autoconfig devices */
#ifdef HACKER_KERNEL
void (*exit_func)(void); /* addr of function to exit kernel */
unsigned long chip_addr; /* start of chip memory (bytes) */
#endif
unsigned long chip_size; /* size of chip memory (bytes) */
unsigned char vblank; /* VBLANK frequency */
unsigned char psfreq; /* power supply frequency */
unsigned long eclock; /* EClock frequency */
unsigned long chipset; /* native chipset present */
struct {
/* video hardware */
AMIGAHW_DECLARE(AMI_VIDEO); /* Amiga Video */
AMIGAHW_DECLARE(AMI_BLITTER); /* Amiga Blitter */
AMIGAHW_DECLARE(AMBER_FF); /* Amber Flicker Fixer */
/* sound hardware */
AMIGAHW_DECLARE(AMI_AUDIO); /* Amiga Audio */
/* disk storage interfaces */
AMIGAHW_DECLARE(AMI_FLOPPY); /* Amiga Floppy */
AMIGAHW_DECLARE(A3000_SCSI); /* SCSI (wd33c93, A3000 alike) */
AMIGAHW_DECLARE(A4000_SCSI); /* SCSI (ncr53c710, A4000T alike) */
AMIGAHW_DECLARE(A1200_IDE); /* IDE (A1200 alike) */
AMIGAHW_DECLARE(A4000_IDE); /* IDE (A4000 alike) */
AMIGAHW_DECLARE(CD_ROM); /* CD ROM drive */
/* other I/O hardware */
AMIGAHW_DECLARE(AMI_KEYBOARD); /* Amiga Keyboard */
AMIGAHW_DECLARE(AMI_MOUSE); /* Amiga Mouse */
AMIGAHW_DECLARE(AMI_SERIAL); /* Amiga Serial */
AMIGAHW_DECLARE(AMI_PARALLEL); /* Amiga Parallel */
/* real time clocks */
AMIGAHW_DECLARE(A2000_CLK); /* Hardware Clock (A2000 alike) */
AMIGAHW_DECLARE(A3000_CLK); /* Hardware Clock (A3000 alike) */
/* supporting hardware */
AMIGAHW_DECLARE(CHIP_RAM); /* Chip RAM */
AMIGAHW_DECLARE(PAULA); /* Paula (8364) */
AMIGAHW_DECLARE(DENISE); /* Denise (8362) */
AMIGAHW_DECLARE(DENISE_HR); /* Denise (8373) */
AMIGAHW_DECLARE(LISA); /* Lisa (8375) */
AMIGAHW_DECLARE(AGNUS_PAL); /* Normal/Fat PAL Agnus (8367/8371) */
AMIGAHW_DECLARE(AGNUS_NTSC); /* Normal/Fat NTSC Agnus (8361/8370) */
AMIGAHW_DECLARE(AGNUS_HR_PAL); /* Fat Hires PAL Agnus (8372) */
AMIGAHW_DECLARE(AGNUS_HR_NTSC); /* Fat Hires NTSC Agnus (8372) */
AMIGAHW_DECLARE(ALICE_PAL); /* PAL Alice (8374) */
AMIGAHW_DECLARE(ALICE_NTSC); /* NTSC Alice (8374) */
AMIGAHW_DECLARE(MAGIC_REKICK); /* A3000 Magic Hard Rekick */
AMIGAHW_DECLARE(ZORRO); /* Zorro AutoConfig */
} hw_present;
};
#else /* __ASSEMBLY__ */
BI_amiga_model = BI_un
BI_amiga_num_autcon = BI_amiga_model+4
BI_amiga_autocon = BI_amiga_num_autcon+4
#ifdef HACKER_KERNEL
BI_amiga_exit_func = BI_amiga_autocon+(CD_sizeof*NUM_AUTO)
BI_amiga_chip_addr = BI_amiga_exit_func+4
BI_amiga_chip_size = BI_amiga_chip_addr+4
#else
BI_amiga_chip_size = BI_amiga_autocon+(CD_sizeof*NUM_AUTO)
#endif
BI_amiga_vblank = BI_amiga_chip_size+4
BI_amiga_psfreq = BI_amiga_vblank+1
BI_amiga_eclock = BI_amiga_psfreq+1
BI_amiga_chipset = BI_amiga_eclock+4
BI_amiga_hw_present = BI_amiga_chipset+4
#endif /* __ASSEMBLY__ */
/* Atari specific part of bootinfo */
/*
* Define several Hardware-Chips for indication so that for the ATARI we do
* no longer decide whether it is a Falcon or other machine . It's just
* important what hardware the machine uses
*/
/* ++roman 08/08/95: rewritten from ORing constants to a C bitfield */
#ifndef __ASSEMBLY__
#define ATARIHW_DECLARE(name) unsigned name : 1
#define ATARIHW_SET(name) (boot_info.bi_atari.hw_present.name = 1)
#define ATARIHW_PRESENT(name) (boot_info.bi_atari.hw_present.name)
struct bi_Atari {
struct {
/* video hardware */
ATARIHW_DECLARE(STND_SHIFTER); /* ST-Shifter - no base low ! */
ATARIHW_DECLARE(EXTD_SHIFTER); /* STe-Shifter - 24 bit address */
ATARIHW_DECLARE(TT_SHIFTER); /* TT-Shifter */
ATARIHW_DECLARE(VIDEL_SHIFTER); /* Falcon-Shifter */
/* sound hardware */
ATARIHW_DECLARE(YM_2149); /* Yamaha YM 2149 */
ATARIHW_DECLARE(PCM_8BIT); /* PCM-Sound in STe-ATARI */
ATARIHW_DECLARE(CODEC); /* CODEC Sound (Falcon) */
/* disk storage interfaces */
ATARIHW_DECLARE(TT_SCSI); /* Directly mapped NCR5380 */
ATARIHW_DECLARE(ST_SCSI); /* NCR5380 via ST-DMA (Falcon) */
ATARIHW_DECLARE(ACSI); /* Standard ACSI like in STs */
ATARIHW_DECLARE(IDE); /* IDE Interface */
ATARIHW_DECLARE(FDCSPEED); /* 8/16 MHz switch for FDC */
/* other I/O hardware */
ATARIHW_DECLARE(ST_MFP); /* The ST-MFP (there should
be no Atari without
it... but who knows?) */
ATARIHW_DECLARE(TT_MFP); /* 2nd MFP */
ATARIHW_DECLARE(SCC); /* Serial Communications Contr. */
ATARIHW_DECLARE(ST_ESCC); /* SCC Z83230 in an ST */
ATARIHW_DECLARE(ANALOG_JOY); /* Paddle Interface for STe
and Falcon */
ATARIHW_DECLARE(MICROWIRE); /* Microwire Interface */
/* DMA */
ATARIHW_DECLARE(STND_DMA); /* 24 Bit limited ST-DMA */
ATARIHW_DECLARE(EXTD_DMA); /* 32 Bit ST-DMA */
ATARIHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */
ATARIHW_DECLARE(SCC_DMA); /* DMA for the SCC */
/* real time clocks */
ATARIHW_DECLARE(TT_CLK); /* TT compatible clock chip */
ATARIHW_DECLARE(MSTE_CLK); /* Mega ST(E) clock chip */
/* supporting hardware */
ATARIHW_DECLARE(SCU); /* System Control Unit */
ATARIHW_DECLARE(BLITTER); /* Blitter */
ATARIHW_DECLARE(VME); /* VME Bus */
} hw_present;
unsigned long mch_cookie; /* _MCH cookie from TOS */
};
/* mch_cookie values (upper word) */
#define ATARI_MCH_ST 0
#define ATARI_MCH_STE 1
#define ATARI_MCH_TT 2
#define ATARI_MCH_FALCON 3
struct mem_info {
unsigned long addr; /* physical address of memory chunk */
unsigned long size; /* length of memory chunk (in bytes) */
};
#else /* __ASSEMBLY__ */
MI_addr = 0
MI_size = MI_addr+4
MI_sizeof = MI_size+4
#endif /* __ASSEMBLY__ */
#define NUM_MEMINFO 4
#define MACH_AMIGA 1
#define MACH_ATARI 2
#define MACH_MAC 3
/*
* CPU and FPU types
*/
#define CPUB_68020 0
#define CPUB_68030 1
#define CPUB_68040 2
#define CPUB_68060 3
#define FPUB_68881 5
#define FPUB_68882 6
#define FPUB_68040 7 /* Internal FPU */
#define FPUB_68060 8 /* Internal FPU */
#define CPU_68020 (1<<CPUB_68020)
#define CPU_68030 (1<<CPUB_68030)
#define CPU_68040 (1<<CPUB_68040)
#define CPU_68060 (1<<CPUB_68060)
#define CPU_MASK (31)
#define FPU_68881 (1<<FPUB_68881)
#define FPU_68882 (1<<FPUB_68882)
#define FPU_68040 (1<<FPUB_68040) /* Internal FPU */
#define FPU_68060 (1<<FPUB_68060) /* Internal FPU */
#define FPU_MASK (0xfe0)
#define CL_SIZE (256)
/*
* machine type definitions
*/
#if !defined(CONFIG_AMIGA)
# define MACH_IS_AMIGA (0)
#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
# define MACH_IS_AMIGA (boot_info.machtype == MACH_AMIGA)
#else
# define CONFIG_AMIGA_ONLY
# define MACH_IS_AMIGA (1)
# define MACH_TYPE (MACH_AMIGA)
#endif
#if !defined(CONFIG_ATARI)
# define MACH_IS_ATARI (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
# define MACH_IS_ATARI (boot_info.machtype == MACH_ATARI)
#else
# define CONFIG_ATARI_ONLY
# define MACH_IS_ATARI (1)
# define MACH_TYPE (MACH_ATARI)
#endif
#if defined(CONFIG_MAC)
# error Currently no Mac support!
#endif
#ifndef MACH_TYPE
# define MACH_TYPE (boot_info.machtype)
#endif
/*
* cpu type definitions
*/
#if !defined(CONFIG_M68020)
# define CPU_IS_020 (0)
#elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
# define CPU_IS_020 (boot_info.cputype & CPU_68020)
#else
# define CONFIG_M68020_ONLY
# define CPU_IS_020 (1)
#endif
#if !defined(CONFIG_M68030)
# define CPU_IS_030 (0)
#elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
# define CPU_IS_030 (boot_info.cputype & CPU_68030)
#else
# define CONFIG_M68030_ONLY
# define CPU_IS_030 (1)
#endif
#if !defined(CONFIG_M68040)
# define CPU_IS_040 (0)
#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
# define CPU_IS_040 (boot_info.cputype & CPU_68040)
#else
# define CONFIG_M68040_ONLY
# define CPU_IS_040 (1)
#endif
#if !defined(CONFIG_M68060)
# define CPU_IS_060 (0)
#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
# define CPU_IS_060 (boot_info.cputype & CPU_68060)
#else
# define CONFIG_M68060_ONLY
# define CPU_IS_060 (1)
#endif
#if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
# define CPU_IS_020_OR_030 (0)
#else
# define CONFIG_M68020_OR_M68030
# if defined(CONFIG_M68040) || defined(CONFIG_M68060)
# define CPU_IS_020_OR_030 (!m68k_is040or060)
# else
# define CONFIG_M68020_OR_M68030_ONLY
# define CPU_IS_020_OR_030 (1)
# endif
#endif
#if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
# define CPU_IS_040_OR_060 (0)
#else
# define CONFIG_M68040_OR_M68060
# if defined(CONFIG_M68020) || defined(CONFIG_M68030)
# define CPU_IS_040_OR_060 (m68k_is040or060)
# else
# define CONFIG_M68040_OR_M68060_ONLY
# define CPU_IS_040_OR_060 (1)
# endif
#endif
#define CPU_TYPE (boot_info.cputype)
#ifndef __ASSEMBLY__
#ifdef __KERNEL__
/*
* m68k_is040or060 is != 0 for a '040 or higher;
* used numbers are 4 for 68040 and 6 for 68060.
*/
extern int m68k_is040or060;
#endif
struct bootinfo {
unsigned long machtype; /* machine type */
unsigned long cputype; /* system CPU & FPU */
struct mem_info memory[NUM_MEMINFO]; /* memory description */
int num_memory; /* # of memory blocks found */
unsigned long ramdisk_size; /* ramdisk size in 1024 byte blocks */
unsigned long ramdisk_addr; /* address of the ram disk in mem */
char command_line[CL_SIZE]; /* kernel command line parameters */
union {
struct bi_Amiga bi_ami; /* Amiga specific information */
struct bi_Atari bi_ata; /* Atari specific information */
} bi_un;
};
#define bi_amiga bi_un.bi_ami
#define bi_atari bi_un.bi_ata
#define bi_mac bi_un.bi_mac
extern struct bootinfo
boot_info;
#else /* __ASSEMBLY__ */
BI_machtype = 0
BI_cputype = BI_machtype+4
BI_memory = BI_cputype+4
BI_num_memory = BI_memory+(MI_sizeof*NUM_MEMINFO)
BI_ramdisk_size = BI_num_memory+4
BI_ramdisk_addr = BI_ramdisk_size+4
BI_command_line = BI_ramdisk_addr+4
BI_un = BI_command_line+CL_SIZE
#endif /* __ASSEMBLY__ */
/*
* Stuff for bootinfo interface versioning
*
* At the start of kernel code, a 'struct bootversion' is located. bootstrap
* checks for a matching version of the interface before booting a kernel, to
* avoid user confusion if kernel and bootstrap don't work together :-)
*
* If incompatible changes are made to the bootinfo interface, the major
* number below should be stepped (and the minor reset to 0) for the
* appropriate machine. If a change is backward-compatible, the minor should
* be stepped. "Backwards-compatible" means that booting will work, but
* certain features may not.
*/
#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor))
#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
#define BI_VERSION_MINOR(v) ((v) & 0xffff)
#ifndef __ASSEMBLY__
struct bootversion {
unsigned short branch;
unsigned long magic;
struct {
unsigned long machtype;
unsigned long version;
} machversions[0];
};
#endif /* __ASSEMBLY__ */
#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#define ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#endif
#endif /* _M68K_SETUP_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/shm.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/shm.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: shm.h
===================================================================
#ifndef _I960_SHM_H
#define _I960_SHM_H
/* format of page table entries that correspond to shared memory pages
currently out in swap space (see also mm/swap.c):
bits 0-1 (PAGE_PRESENT) is = 0
bits 8..2 (SWP_TYPE) are = SHM_SWP_TYPE
bits 31..9 are used like this:
bits 15..9 (SHM_ID) the id of the shared memory segment
bits 30..16 (SHM_IDX) the index of the page within the shared memory segment
(actually only bits 25..16 get used since SHMMAX is so low)
bit 31 (SHM_READ_ONLY) flag whether the page belongs to a read-only attach
*/
/* FIXME does this comment mean anything on the i960? */
/* on the m68k both bits 0 and 1 must be zero */
#define SHM_ID_SHIFT 9
#define _SHM_ID_BITS 7
#define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1)
#define SHM_IDX_SHIFT (SHM_ID_SHIFT+_SHM_ID_BITS)
#define _SHM_IDX_BITS 15
#define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1)
#endif /* _I960_SHM_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/shmparam.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/shmparam.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: shmparam.h
===================================================================
#ifndef _I960_SHMPARAM_H
#define _I960_SHMPARAM_H
/* FIXME what do these addresses mean on the NO_MM i960? */
/* address range for shared memory attaches if no address passed to shmat() */
#define SHM_RANGE_START 0xC0000000
#define SHM_RANGE_END 0xD0000000
/*
* 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 0x1000000 /* max shared seg size (bytes) */
#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 /* _I960_SHMPARAM_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/sigcontext.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/sigcontext.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: sigcontext.h
===================================================================
#ifndef _ASMm68k_SIGCONTEXT_H
#define _ASMm68k_SIGCONTEXT_H
/* FIXME huh? */
struct sigcontext_struct {
unsigned long sc_mask; /* old sigmask */
unsigned long sc_usp; /* old user stack pointer */
unsigned long sc_d0;
unsigned long sc_d1;
unsigned long sc_a0;
unsigned long sc_a1;
unsigned short sc_sr;
unsigned long sc_pc;
unsigned short sc_formatvec;
};
#endif
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/signal.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/signal.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: signal.h
===================================================================
#ifndef _I960_SIGNAL_H
#define _I960_SIGNAL_H
typedef unsigned long sigset_t; /* at least 32 bits */
/* An evil possibility: 31 would let us store a signal_struct within 508 bytes */
#define _NSIG 32
#define NSIG _NSIG
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT 6
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10
#define SIGSEGV 11
#define SIGUSR2 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGSTKFLT 16
#define SIGCHLD 17
#define SIGCONT 18
#define SIGSTOP 19
#define SIGTSTP 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGURG 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGIO 29
#define SIGPOLL SIGIO
/*
#define SIGLOST 29
*/
#define SIGPWR 30
#define SIGUNUSED 31
/*
* sa_flags values: SA_STACK is not currently supported, but will allow the
* usage of signal stacks by using the (now obsolete) sa_restorer field in
* the sigaction structure as a stack pointer. This is now possible due to
* the changes in signal handling. LBT 010493.
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
* SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
*/
#define SA_NOCLDSTOP 1
#define SA_SHIRQ 0x04000000
#define SA_STACK 0x08000000
#define SA_RESTART 0x10000000
#define SA_INTERRUPT 0x20000000
#define SA_NOMASK 0x40000000
#define SA_ONESHOT 0x80000000
#ifdef __KERNEL__
/*
* These values of sa_flags are used only by the kernel as part of the
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#endif
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */
typedef void (*__sighandler_t)(int);
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
struct sigaction {
__sighandler_t sa_handler;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
#ifdef __KERNEL__
#include <asm/sigcontext.h>
#endif
#endif /* _I960_SIGNAL_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/socket.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/socket.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: socket.h
===================================================================
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H
#include <asm/sockios.h>
/* For setsockoptions(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
#define SO_ERROR 4
#define SO_DONTROUTE 5
#define SO_BROADCAST 6
#define SO_SNDBUF 7
#define SO_RCVBUF 8
#define SO_KEEPALIVE 9
#define SO_OOBINLINE 10
#define SO_NO_CHECK 11
#define SO_PRIORITY 12
#define SO_LINGER 13
#define SO_BSDCOMPAT 14
/* To add :#define SO_REUSEPORT 15 */
#define SO_BINDTODEVICE 25
#endif /* _ASM_SOCKET_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/sockios.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/sockios.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: sockios.h
===================================================================
#ifndef __ARCH_I960_SOCKIOS__
#define __ARCH_I960_SOCKIOS__
/* Socket-level I/O control calls. */
#define FIOSETOWN 0x8901
#define SIOCSPGRP 0x8902
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
#define SIOCGSTAMP 0x8906 /* Get stamp */
#endif /* __ARCH_I960_SOCKIOS__ */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/stat.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/stat.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: stat.h
===================================================================
#ifndef _I960_STAT_H
#define _I960_STAT_H
struct old_stat {
unsigned short st_dev;
unsigned short st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned short st_rdev;
unsigned long st_size;
unsigned long st_atime;
unsigned long st_mtime;
unsigned long st_ctime;
};
struct new_stat {
unsigned short st_dev;
unsigned short __pad1;
unsigned long st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned short st_rdev;
unsigned short __pad2;
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
unsigned long st_atime;
unsigned long __unused1;
unsigned long st_mtime;
unsigned long __unused2;
unsigned long st_ctime;
unsigned long __unused3;
unsigned long __unused4;
unsigned long __unused5;
};
#endif /* _I960_STAT_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/statfs.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/statfs.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: statfs.h
===================================================================
#ifndef _I960_STATFS_H
#define _I960_STATFS_H
#ifndef __KERNEL_STRICT_NAMES
#include <linux/types.h>
typedef __kernel_fsid_t fsid_t;
#endif
struct statfs {
long f_type;
long f_bsize;
long f_blocks;
long f_bfree;
long f_bavail;
long f_files;
long f_ffree;
__kernel_fsid_t f_fsid;
long f_namelen;
long f_spare[6];
};
#endif /* _I960_STATFS_H */
1.1 or1k/rc203soc/sw/uClinux/include/asm-i960/string.h
http://www.opencores.org/cvsweb.shtml/or1k/rc203soc/sw/uClinux/include/asm-i960/string.h?rev=1.1&content-type=text/x-cvsweb-markup
Index: string.h
===================================================================
#ifndef _I960_STRING_H_
#define _I960_STRING_H_
/* FIXME we should probably do this, since the i960 can move 16 bytes in
only a few cycles if in cache, whereas stock strcpy is going to SUCK */
#include <linux/config.h>
#include <asm/page.h>
#if 0
#define __HAVE_ARCH_STRCPY
extern inline char * strcpy(char * dest,const char *src)
{
char *xdest = dest;
__asm__ __volatile__
("1:\tmoveb %1 at +,%0 at +\n\t"
"jne 1b"
: "=a" (dest), "=a" (src)
: "0" (dest), "1" (src) : "memory");
return xdest;
}
#define __HAVE_ARCH_STRNCPY
extern inline char * strncpy(char *dest, const char *src, size_t n)
{
char *xdest = dest;
if (n == 0)
return xdest;
__asm__ __volatile__
("1:\tmoveb %1 at +,%0 at +\n\t"
"jeq 2f\n\t"
"subql #1,%2\n\t"
"jne 1b\n\t"
"2:"
: "=a" (dest), "=a" (src), "=d" (n)
: "0" (dest), "1" (src), "2" (n)
: "memory");
return xdest;
}
#define __HAVE_ARCH_STRCAT
extern inline char * strcat(char * dest, const char * src)
{
char *tmp = dest;
while (*dest)
dest++;
while ((*dest++ = *src++))
;
return tmp;
}
#define __HAVE_ARCH_STRNCAT
extern inline char * strncat(char *dest, const char *src, size_t count)
{
char *tmp = dest;
if (count) {
while (*dest)
dest++;
while ((*dest++ = *src++)) {
if (--count == 0) {
*dest++='\0';
break;
}
}
}
return tmp;
}
#define __HAVE_ARCH_STRCHR
extern inline char * strchr(const char * s, int c)
{
const char ch = c;
for(; *s != ch; ++s)
if (*s == '\0')
return( NULL );
return( (char *) s);
}
#define __HAVE_ARCH_STRPBRK
extern inline char * strpbrk(const char * cs,const char * ct)
{
const char *sc1,*sc2;
for( sc1 = cs; *sc1 != '\0'; ++sc1)
for( sc2 = ct; *sc2 != '\0'; ++sc2)
if (*sc1 == *sc2)
return((char *) sc1);
return( NULL );
}
#define __HAVE_ARCH_STRSPN
extern inline size_t strspn(const char *s, const char *accept)
{
const char *p;
const char *a;
size_t count = 0;
for (p = s; *p != '\0'; ++p)
{
for (a = accept; *a != '\0'; ++a)
if (*p == *a)
break;
if (*a == '\0')
return count;
else
++count;
}
return count;
}
#define __HAVE_ARCH_STRTOK
extern inline char * strtok(char * s,const char * ct)
{
char *sbegin, *send;
sbegin = s ? s : ___strtok;
if (!sbegin) {
return NULL;
}
sbegin += strspn(sbegin,ct);
if (*sbegin == '\0') {
___strtok = NULL;
return( NULL );
}
send = strpbrk( sbegin, ct);
if (send && *send != '\0')
*send++ = '\0';
___strtok = send;
return (sbegin);
}
/* strstr !! */
#define __HAVE_ARCH_STRLEN
extern inline size_t strlen(const char * s)
{
const char *sc;
for (sc = s; *sc != '\0'; ++sc) ;
return(sc - s);
}
/* strnlen !! */
#define __HAVE_ARCH_STRCMP
extern inline int strcmp(const char * cs,const char * ct)
{
char __res;
__asm__
("1:\tmoveb %0 at +,%2\n\t" /* get *cs */
"cmpb %1 at +,%2\n\t" /* compare a byte */
"jne 2f\n\t" /* not equal, break out */
"tstb %2\n\t" /* at end of cs? */
"jne 1b\n\t" /* no, keep going */
"jra 3f\n\t" /* strings are equal */
"2:\tsubb %1 at -,%2\n\t" /* *cs - *ct */
"3:"
: "=a" (cs), "=a" (ct), "=d" (__res)
: "0" (cs), "1" (ct));
return __res;
}
#define __HAVE_ARCH_STRNCMP
extern inline int strncmp(const char * cs,const char * ct,size_t count)
{
char __res;
if (!count)
return 0;
__asm__
("1:\tmovb %0 at +,%3\n\t" /* get *cs */
"cmpb %1 at +,%3\n\t" /* compare a byte */
"jne 3f\n\t" /* not equal, break out */
"tstb %3\n\t" /* at end of cs? */
"jeq 4f\n\t" /* yes, all done */
"subql #1,%2\n\t" /* no, adjust count */
"jne 1b\n\t" /* more to do, keep going */
"2:\tmoveq #0,%3\n\t" /* strings are equal */
"jra 4f\n\t"
"3:\tsubb %1 at -,%3\n\t" /* *cs - *ct */
"4:"
: "=a" (cs), "=a" (ct), "=d" (count), "=d" (__res)
: "0" (cs), "1" (ct), "2" (count));
return __res;
}
#define __HAVE_ARCH_MEMSET
/*
* This is really ugly, but its highly optimizatiable by the
* compiler and is meant as compensation for gcc's missing
* __builtin_memset(). For the 680[23]0 it might be worth considering
* the optimal number of misaligned writes compared to the number of
* tests'n'branches needed to align the destination address. The
* 680[46]0 doesn't really care due to their copy-back caches.
* 10/09/96 - Jes Sorensen
*/
extern inline void * __memset_g(void * s, int c, size_t count)
{
void *xs = s;
size_t temp;
if (!count)
return xs;
c &= 0xff;
c |= c << 8;
c |= c << 16;
if (count < 36){
long *ls = s;
switch(count){
case 32: case 33: case 34: case 35:
*ls++ = c;
case 28: case 29: case 30: case 31:
*ls++ = c;
case 24: case 25: case 26: case 27:
*ls++ = c;
case 20: case 21: case 22: case 23:
*ls++ = c;
case 16: case 17: case 18: case 19:
*ls++ = c;
case 12: case 13: case 14: case 15:
*ls++ = c;
case 8: case 9: case 10: case 11:
*ls++ = c;
case 4: case 5: case 6: case 7:
*ls++ = c;
break;
default:
break;
}
s = ls;
if (count & 0x02){
short *ss = s;
*ss++ = c;
s = ss;
}
if (count & 0x01){
char *cs = s;
*cs++ = c;
s = cs;
}
return xs;
}
if ((long) s & 1)
{
char *cs = s;
*cs++ = c;
s = cs;
count--;
}
if (count > 2 && (long) s & 2)
{
short *ss = s;
*ss++ = c;
s = ss;
count -= 2;
}
temp = count >> 2;
if (temp)
{
long *ls = s;
temp--;
do
*ls++ = c;
while (temp--);
s = ls;
}
if (count & 2)
{
short *ss = s;
*ss++ = c;
s = ss;
}
if (count & 1)
|