aboutsummaryrefslogtreecommitdiff
path: root/include/asm-cris
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-cris')
-rw-r--r--include/asm-cris/a.out.h31
-rw-r--r--include/asm-cris/arch-v10/bitops.h73
-rw-r--r--include/asm-cris/arch-v10/byteorder.h26
-rw-r--r--include/asm-cris/arch-v10/cache.h9
-rw-r--r--include/asm-cris/arch-v10/checksum.h29
-rw-r--r--include/asm-cris/arch-v10/delay.h20
-rw-r--r--include/asm-cris/arch-v10/dma.h46
-rw-r--r--include/asm-cris/arch-v10/elf.h71
-rw-r--r--include/asm-cris/arch-v10/io.h193
-rw-r--r--include/asm-cris/arch-v10/irq.h181
-rw-r--r--include/asm-cris/arch-v10/mmu.h106
-rw-r--r--include/asm-cris/arch-v10/offset.h33
-rw-r--r--include/asm-cris/arch-v10/page.h31
-rw-r--r--include/asm-cris/arch-v10/pgtable.h17
-rw-r--r--include/asm-cris/arch-v10/processor.h62
-rw-r--r--include/asm-cris/arch-v10/ptrace.h115
-rw-r--r--include/asm-cris/arch-v10/sv_addr.agh7306
-rw-r--r--include/asm-cris/arch-v10/sv_addr_ag.h139
-rw-r--r--include/asm-cris/arch-v10/svinto.h64
-rw-r--r--include/asm-cris/arch-v10/system.h62
-rw-r--r--include/asm-cris/arch-v10/thread_info.h12
-rw-r--r--include/asm-cris/arch-v10/timex.h30
-rw-r--r--include/asm-cris/arch-v10/tlb.h13
-rw-r--r--include/asm-cris/arch-v10/uaccess.h660
-rw-r--r--include/asm-cris/arch-v10/unistd.h148
-rw-r--r--include/asm-cris/arch-v10/user.h46
-rw-r--r--include/asm-cris/atomic.h150
-rw-r--r--include/asm-cris/axisflashmap.h43
-rw-r--r--include/asm-cris/bitops.h387
-rw-r--r--include/asm-cris/bug.h4
-rw-r--r--include/asm-cris/bugs.h21
-rw-r--r--include/asm-cris/byteorder.h26
-rw-r--r--include/asm-cris/cache.h6
-rw-r--r--include/asm-cris/cacheflush.h31
-rw-r--r--include/asm-cris/checksum.h87
-rw-r--r--include/asm-cris/cputime.h6
-rw-r--r--include/asm-cris/current.h15
-rw-r--r--include/asm-cris/delay.h24
-rw-r--r--include/asm-cris/div64.h1
-rw-r--r--include/asm-cris/dma-mapping.h125
-rw-r--r--include/asm-cris/dma.h13
-rw-r--r--include/asm-cris/elf.h61
-rw-r--r--include/asm-cris/errno.h6
-rw-r--r--include/asm-cris/eshlibld.h114
-rw-r--r--include/asm-cris/ethernet.h18
-rw-r--r--include/asm-cris/etraxgpio.h104
-rw-r--r--include/asm-cris/etraxi2c.h36
-rw-r--r--include/asm-cris/fasttimer.h44
-rw-r--r--include/asm-cris/fcntl.h90
-rw-r--r--include/asm-cris/hardirq.h27
-rw-r--r--include/asm-cris/io.h100
-rw-r--r--include/asm-cris/ioctl.h83
-rw-r--r--include/asm-cris/ioctls.h87
-rw-r--r--include/asm-cris/ipc.h1
-rw-r--r--include/asm-cris/ipcbuf.h29
-rw-r--r--include/asm-cris/irq.h23
-rw-r--r--include/asm-cris/kmap_types.h25
-rw-r--r--include/asm-cris/linkage.h6
-rw-r--r--include/asm-cris/local.h1
-rw-r--r--include/asm-cris/mman.h45
-rw-r--r--include/asm-cris/mmu.h10
-rw-r--r--include/asm-cris/mmu_context.h24
-rw-r--r--include/asm-cris/module.h9
-rw-r--r--include/asm-cris/msgbuf.h33
-rw-r--r--include/asm-cris/namei.h17
-rw-r--r--include/asm-cris/page.h105
-rw-r--r--include/asm-cris/param.h23
-rw-r--r--include/asm-cris/pci.h13
-rw-r--r--include/asm-cris/percpu.h6
-rw-r--r--include/asm-cris/pgalloc.h62
-rw-r--r--include/asm-cris/pgtable.h352
-rw-r--r--include/asm-cris/poll.h25
-rw-r--r--include/asm-cris/posix_types.h74
-rw-r--r--include/asm-cris/processor.h79
-rw-r--r--include/asm-cris/ptrace.h12
-rw-r--r--include/asm-cris/resource.h6
-rw-r--r--include/asm-cris/rs485.h20
-rw-r--r--include/asm-cris/rtc.h107
-rw-r--r--include/asm-cris/scatterlist.h20
-rw-r--r--include/asm-cris/sections.h7
-rw-r--r--include/asm-cris/segment.h8
-rw-r--r--include/asm-cris/semaphore-helper.h81
-rw-r--r--include/asm-cris/semaphore.h142
-rw-r--r--include/asm-cris/sembuf.h25
-rw-r--r--include/asm-cris/setup.h6
-rw-r--r--include/asm-cris/shmbuf.h42
-rw-r--r--include/asm-cris/shmparam.h8
-rw-r--r--include/asm-cris/sigcontext.h24
-rw-r--r--include/asm-cris/siginfo.h6
-rw-r--r--include/asm-cris/signal.h188
-rw-r--r--include/asm-cris/smp.h4
-rw-r--r--include/asm-cris/socket.h54
-rw-r--r--include/asm-cris/sockios.h12
-rw-r--r--include/asm-cris/stat.h81
-rw-r--r--include/asm-cris/statfs.h6
-rw-r--r--include/asm-cris/string.h14
-rw-r--r--include/asm-cris/system.h74
-rw-r--r--include/asm-cris/termbits.h198
-rw-r--r--include/asm-cris/termios.h107
-rw-r--r--include/asm-cris/thread_info.h101
-rw-r--r--include/asm-cris/timex.h24
-rw-r--r--include/asm-cris/tlb.h17
-rw-r--r--include/asm-cris/tlbflush.h43
-rw-r--r--include/asm-cris/topology.h6
-rw-r--r--include/asm-cris/types.h61
-rw-r--r--include/asm-cris/uaccess.h446
-rw-r--r--include/asm-cris/ucontext.h12
-rw-r--r--include/asm-cris/unaligned.h16
-rw-r--r--include/asm-cris/unistd.h392
-rw-r--r--include/asm-cris/user.h52
110 files changed, 14616 insertions, 0 deletions
diff --git a/include/asm-cris/a.out.h b/include/asm-cris/a.out.h
new file mode 100644
index 00000000000..770734ce54a
--- /dev/null
+++ b/include/asm-cris/a.out.h
@@ -0,0 +1,31 @@
+#ifndef __CRIS_A_OUT_H__
+#define __CRIS_A_OUT_H__
+
+/* we don't support a.out binaries on Linux/CRIS anyway, so this is
+ * not really used but still needed because binfmt_elf.c for some reason
+ * wants to know about a.out even if there is no interpreter available...
+ */
+
+/* grabbed from the intel stuff */
+#define STACK_TOP TASK_SIZE
+
+
+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)
+
+
+#endif
diff --git a/include/asm-cris/arch-v10/bitops.h b/include/asm-cris/arch-v10/bitops.h
new file mode 100644
index 00000000000..21b7ae8c9bb
--- /dev/null
+++ b/include/asm-cris/arch-v10/bitops.h
@@ -0,0 +1,73 @@
+/* asm/arch/bitops.h for Linux/CRISv10 */
+
+#ifndef _CRIS_ARCH_BITOPS_H
+#define _CRIS_ARCH_BITOPS_H
+
+/*
+ * Helper functions for the core of the ff[sz] functions, wrapping the
+ * syntactically awkward asms. The asms compute the number of leading
+ * zeroes of a bits-in-byte and byte-in-word and word-in-dword-swapped
+ * number. They differ in that the first function also inverts all bits
+ * in the input.
+ */
+extern inline unsigned long cris_swapnwbrlz(unsigned long w)
+{
+ /* Let's just say we return the result in the same register as the
+ input. Saying we clobber the input but can return the result
+ in another register:
+ ! __asm__ ("swapnwbr %2\n\tlz %2,%0"
+ ! : "=r,r" (res), "=r,X" (dummy) : "1,0" (w));
+ confuses gcc (sched.c, gcc from cris-dist-1.14). */
+
+ unsigned long res;
+ __asm__ ("swapnwbr %0 \n\t"
+ "lz %0,%0"
+ : "=r" (res) : "0" (w));
+ return res;
+}
+
+extern inline unsigned long cris_swapwbrlz(unsigned long w)
+{
+ unsigned res;
+ __asm__ ("swapwbr %0 \n\t"
+ "lz %0,%0"
+ : "=r" (res)
+ : "0" (w));
+ return res;
+}
+
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
+extern inline unsigned long ffz(unsigned long w)
+{
+ return cris_swapnwbrlz(w);
+}
+
+/**
+ * __ffs - find first bit in word.
+ * @word: The word to search
+ *
+ * Undefined if no bit exists, so code should check against 0 first.
+ */
+extern __inline__ unsigned long __ffs(unsigned long word)
+{
+ return cris_swapnwbrlz(~word);
+}
+
+/**
+ * ffs - find first bit set
+ * @x: the word to search
+ *
+ * This is defined the same way as
+ * the libc and compiler builtin ffs routines, therefore
+ * differs in spirit from the above ffz (man ffs).
+ */
+
+extern inline unsigned long kernel_ffs(unsigned long w)
+{
+ return w ? cris_swapwbrlz (w) + 1 : 0;
+}
+
+#endif
diff --git a/include/asm-cris/arch-v10/byteorder.h b/include/asm-cris/arch-v10/byteorder.h
new file mode 100644
index 00000000000..e24465d1f40
--- /dev/null
+++ b/include/asm-cris/arch-v10/byteorder.h
@@ -0,0 +1,26 @@
+#ifndef _CRIS_ARCH_BYTEORDER_H
+#define _CRIS_ARCH_BYTEORDER_H
+
+#include <asm/types.h>
+#include <linux/compiler.h>
+
+/* we just define these two (as we can do the swap in a single
+ * asm instruction in CRIS) and the arch-independent files will put
+ * them together into ntohl etc.
+ */
+
+extern __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+ __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
+
+ return(x);
+}
+
+extern __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
+{
+ __asm__ ("swapb %0" : "=r" (x) : "0" (x));
+
+ return(x);
+}
+
+#endif
diff --git a/include/asm-cris/arch-v10/cache.h b/include/asm-cris/arch-v10/cache.h
new file mode 100644
index 00000000000..1d1d1ba65b1
--- /dev/null
+++ b/include/asm-cris/arch-v10/cache.h
@@ -0,0 +1,9 @@
+#ifndef _ASM_ARCH_CACHE_H
+#define _ASM_ARCH_CACHE_H
+
+/* Etrax 100LX have 32-byte cache-lines. */
+#define L1_CACHE_BYTES 32
+#define L1_CACHE_SHIFT 5
+#define L1_CACHE_SHIFT_MAX 5
+
+#endif /* _ASM_ARCH_CACHE_H */
diff --git a/include/asm-cris/arch-v10/checksum.h b/include/asm-cris/arch-v10/checksum.h
new file mode 100644
index 00000000000..fde1d00aaa9
--- /dev/null
+++ b/include/asm-cris/arch-v10/checksum.h
@@ -0,0 +1,29 @@
+#ifndef _CRIS_ARCH_CHECKSUM_H
+#define _CRIS_ARCH_CHECKSUM_H
+
+/* Checksum some values used in TCP/UDP headers.
+ *
+ * The gain by doing this in asm is that C will not generate carry-additions
+ * for the 32-bit components of the checksum, so otherwise we would have had
+ * to split all of those into 16-bit components, then add.
+ */
+
+extern inline unsigned int
+csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
+ unsigned short proto, unsigned int sum)
+{
+ int res;
+ __asm__ ("add.d %2, %0\n\t"
+ "ax\n\t"
+ "add.d %3, %0\n\t"
+ "ax\n\t"
+ "add.d %4, %0\n\t"
+ "ax\n\t"
+ "addq 0, %0\n"
+ : "=r" (res)
+ : "0" (sum), "r" (daddr), "r" (saddr), "r" ((ntohs(len) << 16) + (proto << 8)));
+
+ return res;
+}
+
+#endif
diff --git a/include/asm-cris/arch-v10/delay.h b/include/asm-cris/arch-v10/delay.h
new file mode 100644
index 00000000000..cfedae0d2f5
--- /dev/null
+++ b/include/asm-cris/arch-v10/delay.h
@@ -0,0 +1,20 @@
+#ifndef _CRIS_ARCH_DELAY_H
+#define _CRIS_ARCH_DELAY_H
+
+extern __inline__ void __delay(int loops)
+{
+ __asm__ __volatile__ (
+ "move.d %0,$r9\n\t"
+ "beq 2f\n\t"
+ "subq 1,$r9\n\t"
+ "1:\n\t"
+ "bne 1b\n\t"
+ "subq 1,$r9\n"
+ "2:"
+ : : "g" (loops) : "r9");
+}
+
+#endif /* defined(_CRIS_ARCH_DELAY_H) */
+
+
+
diff --git a/include/asm-cris/arch-v10/dma.h b/include/asm-cris/arch-v10/dma.h
new file mode 100644
index 00000000000..9e078b9bc93
--- /dev/null
+++ b/include/asm-cris/arch-v10/dma.h
@@ -0,0 +1,46 @@
+/* Defines for using and allocating dma channels. */
+
+#ifndef _ASM_ARCH_DMA_H
+#define _ASM_ARCH_DMA_H
+
+#define MAX_DMA_CHANNELS 10
+
+/* dma0 and dma1 used for network (ethernet) */
+#define NETWORK_TX_DMA_NBR 0
+#define NETWORK_RX_DMA_NBR 1
+
+/* dma2 and dma3 shared by par0, scsi0, ser2 and ata */
+#define PAR0_TX_DMA_NBR 2
+#define PAR0_RX_DMA_NBR 3
+#define SCSI0_TX_DMA_NBR 2
+#define SCSI0_RX_DMA_NBR 3
+#define SER2_TX_DMA_NBR 2
+#define SER2_RX_DMA_NBR 3
+#define ATA_TX_DMA_NBR 2
+#define ATA_RX_DMA_NBR 3
+
+/* dma4 and dma5 shared by par1, scsi1, ser3 and extdma0 */
+#define PAR1_TX_DMA_NBR 4
+#define PAR1_RX_DMA_NBR 5
+#define SCSI1_TX_DMA_NBR 4
+#define SCSI1_RX_DMA_NBR 5
+#define SER3_TX_DMA_NBR 4
+#define SER3_RX_DMA_NBR 5
+#define EXTDMA0_TX_DMA_NBR 4
+#define EXTDMA0_RX_DMA_NBR 5
+
+/* dma6 and dma7 shared by ser0, extdma1 and mem2mem */
+#define SER0_TX_DMA_NBR 6
+#define SER0_RX_DMA_NBR 7
+#define EXTDMA1_TX_DMA_NBR 6
+#define EXTDMA1_RX_DMA_NBR 7
+#define MEM2MEM_TX_DMA_NBR 6
+#define MEM2MEM_RX_DMA_NBR 7
+
+/* dma8 and dma9 shared by ser1 and usb */
+#define SER1_TX_DMA_NBR 8
+#define SER1_RX_DMA_NBR 9
+#define USB_TX_DMA_NBR 8
+#define USB_RX_DMA_NBR 9
+
+#endif
diff --git a/include/asm-cris/arch-v10/elf.h b/include/asm-cris/arch-