diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/sh/include | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'arch/sh/include')
58 files changed, 2291 insertions, 0 deletions
diff --git a/arch/sh/include/asm/auxvec.h b/arch/sh/include/asm/auxvec.h new file mode 100644 index 00000000000..483effd65e0 --- /dev/null +++ b/arch/sh/include/asm/auxvec.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | #ifndef __ASM_SH_AUXVEC_H | ||
| 2 | #define __ASM_SH_AUXVEC_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Architecture-neutral AT_ values in 0-17, leave some room | ||
| 6 | * for more of them. | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* | ||
| 10 | * This entry gives some information about the FPU initialization | ||
| 11 | * performed by the kernel. | ||
| 12 | */ | ||
| 13 | #define AT_FPUCW 18 /* Used FPU control word. */ | ||
| 14 | |||
| 15 | #if defined(CONFIG_VSYSCALL) || !defined(__KERNEL__) | ||
| 16 | /* | ||
| 17 | * Only define this in the vsyscall case, the entry point to | ||
| 18 | * the vsyscall page gets placed here. The kernel will attempt | ||
| 19 | * to build a gate VMA we don't care about otherwise.. | ||
| 20 | */ | ||
| 21 | #define AT_SYSINFO_EHDR 33 | ||
| 22 | #endif | ||
| 23 | |||
| 24 | /* | ||
| 25 | * More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the | ||
| 26 | * value is -1, then the cache doesn't exist. Otherwise: | ||
| 27 | * | ||
| 28 | * bit 0-3: Cache set-associativity; 0 means fully associative. | ||
| 29 | * bit 4-7: Log2 of cacheline size. | ||
| 30 | * bit 8-31: Size of the entire cache >> 8. | ||
| 31 | */ | ||
| 32 | #define AT_L1I_CACHESHAPE 34 | ||
| 33 | #define AT_L1D_CACHESHAPE 35 | ||
| 34 | #define AT_L2_CACHESHAPE 36 | ||
| 35 | |||
| 36 | #endif /* __ASM_SH_AUXVEC_H */ | ||
diff --git a/arch/sh/include/asm/bitsperlong.h b/arch/sh/include/asm/bitsperlong.h new file mode 100644 index 00000000000..6dc0bb0c13b --- /dev/null +++ b/arch/sh/include/asm/bitsperlong.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/bitsperlong.h> | |||
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h new file mode 100644 index 00000000000..db2f5d7cb17 --- /dev/null +++ b/arch/sh/include/asm/byteorder.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef __ASM_SH_BYTEORDER_H | ||
| 2 | #define __ASM_SH_BYTEORDER_H | ||
| 3 | |||
| 4 | #ifdef __LITTLE_ENDIAN__ | ||
| 5 | #include <linux/byteorder/little_endian.h> | ||
| 6 | #else | ||
| 7 | #include <linux/byteorder/big_endian.h> | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif /* __ASM_SH_BYTEORDER_H */ | ||
diff --git a/arch/sh/include/asm/cachectl.h b/arch/sh/include/asm/cachectl.h new file mode 100644 index 00000000000..6ffb4b7a212 --- /dev/null +++ b/arch/sh/include/asm/cachectl.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _SH_CACHECTL_H | ||
| 2 | #define _SH_CACHECTL_H | ||
| 3 | |||
| 4 | /* Definitions for the cacheflush system call. */ | ||
| 5 | |||
| 6 | #define CACHEFLUSH_D_INVAL 0x1 /* invalidate (without write back) */ | ||
| 7 | #define CACHEFLUSH_D_WB 0x2 /* write back (without invalidate) */ | ||
| 8 | #define CACHEFLUSH_D_PURGE 0x3 /* writeback and invalidate */ | ||
| 9 | |||
| 10 | #define CACHEFLUSH_I 0x4 | ||
| 11 | |||
| 12 | /* | ||
| 13 | * Options for cacheflush system call | ||
| 14 | */ | ||
| 15 | #define ICACHE CACHEFLUSH_I /* flush instruction cache */ | ||
| 16 | #define DCACHE CACHEFLUSH_D_PURGE /* writeback and flush data cache */ | ||
| 17 | #define BCACHE (ICACHE|DCACHE) /* flush both caches */ | ||
| 18 | |||
| 19 | #endif /* _SH_CACHECTL_H */ | ||
diff --git a/arch/sh/include/asm/cpu-features.h b/arch/sh/include/asm/cpu-features.h new file mode 100644 index 00000000000..694abe490ed --- /dev/null +++ b/arch/sh/include/asm/cpu-features.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef __ASM_SH_CPU_FEATURES_H | ||
| 2 | #define __ASM_SH_CPU_FEATURES_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Processor flags | ||
| 6 | * | ||
| 7 | * Note: When adding a new flag, keep cpu_flags[] in | ||
| 8 | * arch/sh/kernel/setup.c in sync so symbolic name | ||
| 9 | * mapping of the processor flags has a chance of being | ||
| 10 | * reasonably accurate. | ||
| 11 | * | ||
| 12 | * These flags are also available through the ELF | ||
| 13 | * auxiliary vector as AT_HWCAP. | ||
| 14 | */ | ||
| 15 | #define CPU_HAS_FPU 0x0001 /* Hardware FPU support */ | ||
| 16 | #define CPU_HAS_P2_FLUSH_BUG 0x0002 /* Need to flush the cache in P2 area */ | ||
| 17 | #define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */ | ||
| 18 | #define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */ | ||
| 19 | #define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */ | ||
| 20 | #define CPU_HAS_PTEA 0x0020 /* PTEA register */ | ||
| 21 | #define CPU_HAS_LLSC 0x0040 /* movli.l/movco.l */ | ||
| 22 | #define CPU_HAS_L2_CACHE 0x0080 /* Secondary cache / URAM */ | ||
| 23 | #define CPU_HAS_OP32 0x0100 /* 32-bit instruction support */ | ||
| 24 | #define CPU_HAS_PTEAEX 0x0200 /* PTE ASID Extension support */ | ||
| 25 | |||
| 26 | #endif /* __ASM_SH_CPU_FEATURES_H */ | ||
diff --git a/arch/sh/include/asm/cputime.h b/arch/sh/include/asm/cputime.h new file mode 100644 index 00000000000..6ca395d1393 --- /dev/null +++ b/arch/sh/include/asm/cputime.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __SH_CPUTIME_H | ||
| 2 | #define __SH_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* __SH_CPUTIME_H */ | ||
diff --git a/arch/sh/include/asm/current.h b/arch/sh/include/asm/current.h new file mode 100644 index 00000000000..4c51401b553 --- /dev/null +++ b/arch/sh/include/asm/current.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/current.h> | |||
diff --git a/arch/sh/include/asm/delay.h b/arch/sh/include/asm/delay.h new file mode 100644 index 00000000000..9670e127b7b --- /dev/null +++ b/arch/sh/include/asm/delay.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/delay.h> | |||
diff --git a/arch/sh/include/asm/div64.h b/arch/sh/include/asm/div64.h new file mode 100644 index 00000000000..6cd978cefb2 --- /dev/null +++ b/arch/sh/include/asm/div64.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/div64.h> | |||
diff --git a/arch/sh/include/asm/dma-sh.h b/arch/sh/include/asm/dma-sh.h new file mode 100644 index 00000000000..f3acb8e34c6 --- /dev/null +++ b/arch/sh/include/asm/dma-sh.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/include/asm/dma-sh.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000 Takashi YOSHII | ||
| 5 | * Copyright (C) 2003 Paul Mundt | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 8 | * License. See the file "COPYING" in the main directory of this archive | ||
| 9 | * for more details. | ||
| 10 | */ | ||
| 11 | #ifndef __DMA_SH_H | ||
| 12 | #define __DMA_SH_H | ||
| 13 | |||
| 14 | #include <asm/dma-register.h> | ||
| 15 | #include <cpu/dma-register.h> | ||
| 16 | #include <cpu/dma.h> | ||
| 17 | |||
| 18 | /* DMAOR contorl: The DMAOR access size is different by CPU.*/ | ||
| 19 | #if defined(CONFIG_CPU_SUBTYPE_SH7723) || \ | ||
| 20 | defined(CONFIG_CPU_SUBTYPE_SH7724) || \ | ||
| 21 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | ||
| 22 | defined(CONFIG_CPU_SUBTYPE_SH7785) | ||
| 23 | #define dmaor_read_reg(n) \ | ||
| 24 | (n ? __raw_readw(SH_DMAC_BASE1 + DMAOR) \ | ||
| 25 | : __raw_readw(SH_DMAC_BASE0 + DMAOR)) | ||
| 26 | #define dmaor_write_reg(n, data) \ | ||
| 27 | (n ? __raw_writew(data, SH_DMAC_BASE1 + DMAOR) \ | ||
| 28 | : __raw_writew(data, SH_DMAC_BASE0 + DMAOR)) | ||
| 29 | #else /* Other CPU */ | ||
| 30 | #define dmaor_read_reg(n) __raw_readw(SH_DMAC_BASE0 + DMAOR) | ||
| 31 | #define dmaor_write_reg(n, data) __raw_writew(data, SH_DMAC_BASE0 + DMAOR) | ||
| 32 | #endif | ||
| 33 | |||
| 34 | static int dmte_irq_map[] __maybe_unused = { | ||
| 35 | #if (MAX_DMA_CHANNELS >= 4) | ||
| 36 | DMTE0_IRQ, | ||
| 37 | DMTE0_IRQ + 1, | ||
| 38 | DMTE0_IRQ + 2, | ||
| 39 | DMTE0_IRQ + 3, | ||
| 40 | #endif | ||
| 41 | #if (MAX_DMA_CHANNELS >= 6) | ||
| 42 | DMTE4_IRQ, | ||
| 43 | DMTE4_IRQ + 1, | ||
| 44 | #endif | ||
| 45 | #if (MAX_DMA_CHANNELS >= 8) | ||
| 46 | DMTE6_IRQ, | ||
| 47 | DMTE6_IRQ + 1, | ||
| 48 | #endif | ||
| 49 | #if (MAX_DMA_CHANNELS >= 12) | ||
| 50 | DMTE8_IRQ, | ||
| 51 | DMTE9_IRQ, | ||
| 52 | DMTE10_IRQ, | ||
| 53 | DMTE11_IRQ, | ||
| 54 | #endif | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* | ||
| 58 | * Define the default configuration for dual address memory-memory transfer. | ||
| 59 | * The 0x400 value represents auto-request, external->external. | ||
| 60 | */ | ||
| 61 | #define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_INDEX2VAL(XMIT_SZ_32BIT)) | ||
| 62 | |||
| 63 | /* DMA base address */ | ||
| 64 | static u32 dma_base_addr[] __maybe_unused = { | ||
| 65 | #if (MAX_DMA_CHANNELS >= 4) | ||
| 66 | SH_DMAC_BASE0 + 0x00, /* channel 0 */ | ||
| 67 | SH_DMAC_BASE0 + 0x10, | ||
| 68 | SH_DMAC_BASE0 + 0x20, | ||
| 69 | SH_DMAC_BASE0 + 0x30, | ||
| 70 | #endif | ||
| 71 | #if (MAX_DMA_CHANNELS >= 6) | ||
| 72 | SH_DMAC_BASE0 + 0x50, | ||
| 73 | SH_DMAC_BASE0 + 0x60, | ||
| 74 | #endif | ||
| 75 | #if (MAX_DMA_CHANNELS >= 8) | ||
| 76 | SH_DMAC_BASE1 + 0x00, | ||
| 77 | SH_DMAC_BASE1 + 0x10, | ||
| 78 | #endif | ||
| 79 | #if (MAX_DMA_CHANNELS >= 12) | ||
| 80 | SH_DMAC_BASE1 + 0x20, | ||
| 81 | SH_DMAC_BASE1 + 0x30, | ||
| 82 | SH_DMAC_BASE1 + 0x50, | ||
| 83 | SH_DMAC_BASE1 + 0x60, /* channel 11 */ | ||
| 84 | #endif | ||
| 85 | }; | ||
| 86 | |||
| 87 | #endif /* __DMA_SH_H */ | ||
diff --git a/arch/sh/include/asm/emergency-restart.h b/arch/sh/include/asm/emergency-restart.h new file mode 100644 index 00000000000..108d8c48e42 --- /dev/null +++ b/arch/sh/include/asm/emergency-restart.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
| 2 | #define _ASM_EMERGENCY_RESTART_H | ||
| 3 | |||
| 4 | #include <asm-generic/emergency-restart.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/sh/include/asm/errno.h b/arch/sh/include/asm/errno.h new file mode 100644 index 00000000000..51cf6f9cebb --- /dev/null +++ b/arch/sh/include/asm/errno.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_ERRNO_H | ||
| 2 | #define __ASM_SH_ERRNO_H | ||
| 3 | |||
| 4 | #include <asm-generic/errno.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_ERRNO_H */ | ||
diff --git a/arch/sh/include/asm/fcntl.h b/arch/sh/include/asm/fcntl.h new file mode 100644 index 00000000000..46ab12db573 --- /dev/null +++ b/arch/sh/include/asm/fcntl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/fcntl.h> | |||
diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h new file mode 100644 index 00000000000..855e945c619 --- /dev/null +++ b/arch/sh/include/asm/hwblk.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #ifndef __ASM_SH_HWBLK_H | ||
| 2 | #define __ASM_SH_HWBLK_H | ||
| 3 | |||
| 4 | #include <asm/clock.h> | ||
| 5 | #include <asm/io.h> | ||
| 6 | |||
| 7 | #define HWBLK_CNT_USAGE 0 | ||
| 8 | #define HWBLK_CNT_IDLE 1 | ||
| 9 | #define HWBLK_CNT_DEVICES 2 | ||
| 10 | #define HWBLK_CNT_NR 3 | ||
| 11 | |||
| 12 | #define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */ | ||
| 13 | |||
| 14 | #define HWBLK_AREA(_flags, _parent) \ | ||
| 15 | { \ | ||
| 16 | .flags = _flags, \ | ||
| 17 | .parent = _parent, \ | ||
| 18 | } | ||
| 19 | |||
| 20 | struct hwblk_area { | ||
| 21 | int cnt[HWBLK_CNT_NR]; | ||
| 22 | unsigned char parent; | ||
| 23 | unsigned char flags; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define HWBLK(_mstp, _bit, _area) \ | ||
| 27 | { \ | ||
| 28 | .mstp = (void __iomem *)_mstp, \ | ||
| 29 | .bit = _bit, \ | ||
| 30 | .area = _area, \ | ||
| 31 | } | ||
| 32 | |||
| 33 | struct hwblk { | ||
| 34 | void __iomem *mstp; | ||
| 35 | unsigned char bit; | ||
| 36 | unsigned char area; | ||
| 37 | int cnt[HWBLK_CNT_NR]; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct hwblk_info { | ||
| 41 | struct hwblk_area *areas; | ||
| 42 | int nr_areas; | ||
| 43 | struct hwblk *hwblks; | ||
| 44 | int nr_hwblks; | ||
| 45 | }; | ||
| 46 | |||
| 47 | /* Should be defined by processor-specific code */ | ||
| 48 | int arch_hwblk_init(void); | ||
| 49 | int arch_hwblk_sleep_mode(void); | ||
| 50 | |||
| 51 | int hwblk_register(struct hwblk_info *info); | ||
| 52 | int hwblk_init(void); | ||
| 53 | |||
| 54 | void hwblk_enable(struct hwblk_info *info, int hwblk); | ||
| 55 | void hwblk_disable(struct hwblk_info *info, int hwblk); | ||
| 56 | |||
| 57 | void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int cnt); | ||
| 58 | void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int cnt); | ||
| 59 | |||
| 60 | /* allow clocks to enable and disable hardware blocks */ | ||
| 61 | #define SH_HWBLK_CLK(_hwblk, _parent, _flags) \ | ||
| 62 | [_hwblk] = { \ | ||
| 63 | .parent = _parent, \ | ||
| 64 | .arch_flags = _hwblk, \ | ||
| 65 | .flags = _flags, \ | ||
| 66 | } | ||
| 67 | |||
| 68 | int sh_hwblk_clk_register(struct clk *clks, int nr); | ||
| 69 | |||
| 70 | #endif /* __ASM_SH_HWBLK_H */ | ||
diff --git a/arch/sh/include/asm/ioctl.h b/arch/sh/include/asm/ioctl.h new file mode 100644 index 00000000000..b279fe06dfe --- /dev/null +++ b/arch/sh/include/asm/ioctl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/ioctl.h> | |||
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/asm/ioctls.h new file mode 100644 index 00000000000..a6769f352bf --- /dev/null +++ b/arch/sh/include/asm/ioctls.h | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | #ifndef __ASM_SH_IOCTLS_H | ||
| 2 | #define __ASM_SH_IOCTLS_H | ||
| 3 | |||
| 4 | #include <asm/ioctl.h> | ||
| 5 | |||
| 6 | #define FIOCLEX _IO('f', 1) | ||
| 7 | #define FIONCLEX _IO('f', 2) | ||
| 8 | #define FIOASYNC _IOW('f', 125, int) | ||
| 9 | #define FIONBIO _IOW('f', 126, int) | ||
| 10 | #define FIONREAD _IOR('f', 127, int) | ||
| 11 | #define TIOCINQ FIONREAD | ||
| 12 | #define FIOQSIZE _IOR('f', 128, loff_t) | ||
| 13 | |||
| 14 | #define TCGETS 0x5401 | ||
| 15 | #define TCSETS 0x5402 | ||
| 16 | #define TCSETSW 0x5403 | ||
| 17 | #define TCSETSF 0x5404 | ||
| 18 | |||
| 19 | #define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */ | ||
| 20 | #define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */ | ||
| 21 | #define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */ | ||
| 22 | #define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */ | ||
| 23 | |||
| 24 | #define TCSBRK _IO('t', 29) | ||
| 25 | #define TCXONC _IO('t', 30) | ||
| 26 | #define TCFLSH _IO('t', 31) | ||
| 27 | |||
| 28 | #define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */ | ||
| 29 | #define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */ | ||
| 30 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ | ||
| 31 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ | ||
| 32 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ | ||
| 33 | |||
| 34 | #define TIOCSPGRP _IOW('t', 118, int) | ||
| 35 | #define TIOCGPGRP _IOR('t', 119, int) | ||
| 36 | |||
| 37 | #define TIOCEXCL _IO('T', 12) /* 0x540C */ | ||
| 38 | #define TIOCNXCL _IO('T', 13) /* 0x540D */ | ||
| 39 | #define TIOCSCTTY _IO('T', 14) /* 0x540E */ | ||
| 40 | |||
| 41 | #define TIOCSTI _IOW('T', 18, char) /* 0x5412 */ | ||
| 42 | #define TIOCMGET _IOR('T', 21, unsigned int) /* 0x5415 */ | ||
| 43 | #define TIOCMBIS _IOW('T', 22, unsigned int) /* 0x5416 */ | ||
| 44 | #define TIOCMBIC _IOW('T', 23, unsigned int) /* 0x5417 */ | ||
| 45 | #define TIOCMSET _IOW('T', 24, unsigned int) /* 0x5418 */ | ||
| 46 | # define TIOCM_LE 0x001 | ||
| 47 | # define TIOCM_DTR 0x002 | ||
| 48 | # define TIOCM_RTS 0x004 | ||
| 49 | # define TIOCM_ST 0x008 | ||
| 50 | # define TIOCM_SR 0x010 | ||
| 51 | # define TIOCM_CTS 0x020 | ||
| 52 | # define TIOCM_CAR 0x040 | ||
| 53 | # define TIOCM_RNG 0x080 | ||
| 54 | # define TIOCM_DSR 0x100 | ||
| 55 | # define TIOCM_CD TIOCM_CAR | ||
| 56 | # define TIOCM_RI TIOCM_RNG | ||
| 57 | |||
| 58 | #define TIOCGSOFTCAR _IOR('T', 25, unsigned int) /* 0x5419 */ | ||
| 59 | #define TIOCSSOFTCAR _IOW('T', 26, unsigned int) /* 0x541A */ | ||
| 60 | #define TIOCLINUX _IOW('T', 28, char) /* 0x541C */ | ||
| 61 | #define TIOCCONS _IO('T', 29) /* 0x541D */ | ||
| 62 | #define TIOCGSERIAL 0x803C541E /* _IOR('T', 30, struct serial_struct) 0x541E */ | ||
| 63 | #define TIOCSSERIAL 0x403C541F /* _IOW('T', 31, struct serial_struct) 0x541F */ | ||
| 64 | #define TIOCPKT _IOW('T', 32, int) /* 0x5420 */ | ||
| 65 | # define TIOCPKT_DATA 0 | ||
| 66 | # define TIOCPKT_FLUSHREAD 1 | ||
| 67 | # define TIOCPKT_FLUSHWRITE 2 | ||
| 68 | # define TIOCPKT_STOP 4 | ||
| 69 | # define TIOCPKT_START 8 | ||
| 70 | # define TIOCPKT_NOSTOP 16 | ||
| 71 | # define TIOCPKT_DOSTOP 32 | ||
| 72 | # define TIOCPKT_IOCTL 64 | ||
| 73 | |||
| 74 | |||
| 75 | #define TIOCNOTTY _IO('T', 34) /* 0x5422 */ | ||
| 76 | #define TIOCSETD _IOW('T', 35, int) /* 0x5423 */ | ||
| 77 | #define TIOCGETD _IOR('T', 36, int) /* 0x5424 */ | ||
| 78 | #define TCSBRKP _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */ | ||
| 79 | #define TIOCSBRK _IO('T', 39) /* 0x5427 */ /* BSD compatibility */ | ||
| 80 | #define TIOCCBRK _IO('T', 40) /* 0x5428 */ /* BSD compatibility */ | ||
| 81 | #define TIOCGSID _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */ | ||
| 82 | #define TCGETS2 _IOR('T', 42, struct termios2) | ||
| 83 | #define TCSETS2 _IOW('T', 43, struct termios2) | ||
| 84 | #define TCSETSW2 _IOW('T', 44, struct termios2) | ||
| 85 | #define TCSETSF2 _IOW('T', 45, struct termios2) | ||
| 86 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
| 87 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | ||
| 88 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
| 89 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | ||
| 90 | #define TIOCVHANGUP _IO('T', 0x37) | ||
| 91 | |||
| 92 | #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ | ||
| 93 | #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ | ||
| 94 | #define TIOCSERSWILD _IOW('T', 85, int) /* 0x5455 */ | ||
| 95 | #define TIOCGLCKTRMIOS 0x5456 | ||
| 96 | #define TIOCSLCKTRMIOS 0x5457 | ||
| 97 | #define TIOCSERGSTRUCT 0x80d85458 /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */ | ||
| 98 | #define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */ | ||
| 99 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
| 100 | # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
| 101 | #define TIOCSERGETMULTI 0x80A8545A /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */ | ||
| 102 | #define TIOCSERSETMULTI 0x40A8545B /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ | ||
| 103 | |||
| 104 | #define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ | ||
| 105 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
| 106 | |||
| 107 | #endif /* __ASM_SH_IOCTLS_H */ | ||
diff --git a/arch/sh/include/asm/ipcbuf.h b/arch/sh/include/asm/ipcbuf.h new file mode 100644 index 00000000000..84c7e51cb6d --- /dev/null +++ b/arch/sh/include/asm/ipcbuf.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/ipcbuf.h> | |||
diff --git a/arch/sh/include/asm/irq_regs.h b/arch/sh/include/asm/irq_regs.h new file mode 100644 index 00000000000..3dd9c0b7027 --- /dev/null +++ b/arch/sh/include/asm/irq_regs.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/irq_regs.h> | |||
diff --git a/arch/sh/include/asm/local.h b/arch/sh/include/asm/local.h new file mode 100644 index 00000000000..9ed9b9cb459 --- /dev/null +++ b/arch/sh/include/asm/local.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef __ASM_SH_LOCAL_H | ||
| 2 | #define __ASM_SH_LOCAL_H | ||
| 3 | |||
| 4 | #include <asm-generic/local.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_LOCAL_H */ | ||
| 7 | |||
diff --git a/arch/sh/include/asm/local64.h b/arch/sh/include/asm/local64.h new file mode 100644 index 00000000000..36c93b5cc23 --- /dev/null +++ b/arch/sh/include/asm/local64.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/local64.h> | |||
diff --git a/arch/sh/include/asm/memblock.h b/arch/sh/include/asm/memblock.h new file mode 100644 index 00000000000..e87063fad2e --- /dev/null +++ b/arch/sh/include/asm/memblock.h | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #ifndef __ASM_SH_MEMBLOCK_H | ||
| 2 | #define __ASM_SH_MEMBLOCK_H | ||
| 3 | |||
| 4 | #endif /* __ASM_SH_MEMBLOCK_H */ | ||
diff --git a/arch/sh/include/asm/mman.h b/arch/sh/include/asm/mman.h new file mode 100644 index 00000000000..8eebf89f5ab --- /dev/null +++ b/arch/sh/include/asm/mman.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/mman.h> | |||
diff --git a/arch/sh/include/asm/msgbuf.h b/arch/sh/include/asm/msgbuf.h new file mode 100644 index 00000000000..809134c644a --- /dev/null +++ b/arch/sh/include/asm/msgbuf.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/msgbuf.h> | |||
diff --git a/arch/sh/include/asm/param.h b/arch/sh/include/asm/param.h new file mode 100644 index 00000000000..965d4542797 --- /dev/null +++ b/arch/sh/include/asm/param.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/param.h> | |||
diff --git a/arch/sh/include/asm/parport.h b/arch/sh/include/asm/parport.h new file mode 100644 index 00000000000..cf252af6459 --- /dev/null +++ b/arch/sh/include/asm/parport.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/parport.h> | |||
diff --git a/arch/sh/include/asm/percpu.h b/arch/sh/include/asm/percpu.h new file mode 100644 index 00000000000..4db4b39a439 --- /dev/null +++ b/arch/sh/include/asm/percpu.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ARCH_SH_PERCPU | ||
| 2 | #define __ARCH_SH_PERCPU | ||
| 3 | |||
| 4 | #include <asm-generic/percpu.h> | ||
| 5 | |||
| 6 | #endif /* __ARCH_SH_PERCPU */ | ||
diff --git a/arch/sh/include/asm/poll.h b/arch/sh/include/asm/poll.h new file mode 100644 index 00000000000..c98509d3149 --- /dev/null +++ b/arch/sh/include/asm/poll.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/poll.h> | |||
diff --git a/arch/sh/include/asm/posix_types_32.h b/arch/sh/include/asm/posix_types_32.h new file mode 100644 index 00000000000..6a9ceaaf1ae --- /dev/null +++ b/arch/sh/include/asm/posix_types_32.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #ifndef __ASM_SH_POSIX_TYPES_32_H | ||
| 2 | #define __ASM_SH_POSIX_TYPES_32_H | ||
| 3 | |||
| 4 | typedef unsigned short __kernel_mode_t; | ||
| 5 | #define __kernel_mode_t __kernel_mode_t | ||
| 6 | typedef unsigned short __kernel_nlink_t; | ||
| 7 | #define __kernel_nlink_t __kernel_nlink_t | ||
| 8 | typedef unsigned short __kernel_ipc_pid_t; | ||
| 9 | #define __kernel_ipc_pid_t __kernel_ipc_pid_t | ||
| 10 | typedef unsigned short __kernel_uid_t; | ||
| 11 | #define __kernel_uid_t __kernel_uid_t | ||
| 12 | typedef unsigned short __kernel_gid_t; | ||
| 13 | #define __kernel_gid_t __kernel_gid_t | ||
| 14 | |||
| 15 | typedef unsigned int __kernel_uid32_t; | ||
| 16 | #define __kernel_uid32_t __kernel_uid32_t | ||
| 17 | typedef unsigned int __kernel_gid32_t; | ||
| 18 | #define __kernel_gid32_t __kernel_gid32_t | ||
| 19 | |||
| 20 | typedef unsigned short __kernel_old_uid_t; | ||
| 21 | #define __kernel_old_uid_t __kernel_old_uid_t | ||
| 22 | typedef unsigned short __kernel_old_gid_t; | ||
| 23 | #define __kernel_old_gid_t __kernel_old_gid_t | ||
| 24 | typedef unsigned short __kernel_old_dev_t; | ||
| 25 | #define __kernel_old_dev_t __kernel_old_dev_t | ||
| 26 | |||
| 27 | #include <asm-generic/posix_types.h> | ||
| 28 | |||
| 29 | #endif /* __ASM_SH_POSIX_TYPES_32_H */ | ||
diff --git a/arch/sh/include/asm/posix_types_64.h b/arch/sh/include/asm/posix_types_64.h new file mode 100644 index 00000000000..8cd11485c06 --- /dev/null +++ b/arch/sh/include/asm/posix_types_64.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef __ASM_SH_POSIX_TYPES_64_H | ||
| 2 | #define __ASM_SH_POSIX_TYPES_64_H | ||
| 3 | |||
| 4 | typedef unsigned short __kernel_mode_t; | ||
| 5 | #define __kernel_mode_t __kernel_mode_t | ||
| 6 | typedef unsigned short __kernel_nlink_t; | ||
| 7 | #define __kernel_nlink_t __kernel_nlink_t | ||
| 8 | typedef unsigned short __kernel_ipc_pid_t; | ||
| 9 | #define __kernel_ipc_pid_t __kernel_ipc_pid_t | ||
| 10 | typedef unsigned short __kernel_uid_t; | ||
| 11 | #define __kernel_uid_t __kernel_uid_t | ||
| 12 | typedef unsigned short __kernel_gid_t; | ||
| 13 | #define __kernel_gid_t __kernel_gid_t | ||
| 14 | typedef long unsigned int __kernel_size_t; | ||
| 15 | #define __kernel_size_t __kernel_size_t | ||
| 16 | typedef int __kernel_ssize_t; | ||
| 17 | #define __kernel_ssize_t __kernel_ssize_t | ||
| 18 | typedef int __kernel_ptrdiff_t; | ||
| 19 | #define __kernel_ptrdiff_t __kernel_ptrdiff_t | ||
| 20 | typedef unsigned int __kernel_uid32_t; | ||
| 21 | #define __kernel_uid32_t __kernel_uid32_t | ||
| 22 | typedef unsigned int __kernel_gid32_t; | ||
| 23 | #define __kernel_gid32_t __kernel_gid32_t | ||
| 24 | |||
| 25 | typedef unsigned short __kernel_old_uid_t; | ||
| 26 | #define __kernel_old_uid_t __kernel_old_uid_t | ||
| 27 | typedef unsigned short __kernel_old_gid_t; | ||
| 28 | #define __kernel_old_gid_t __kernel_old_gid_t | ||
| 29 | typedef unsigned short __kernel_old_dev_t; | ||
| 30 | #define __kernel_old_dev_t __kernel_old_dev_t | ||
| 31 | |||
| 32 | #include <asm-generic/posix_types.h> | ||
| 33 | |||
| 34 | #endif /* __ASM_SH_POSIX_TYPES_64_H */ | ||
diff --git a/arch/sh/include/asm/resource.h b/arch/sh/include/asm/resource.h new file mode 100644 index 00000000000..9c2499a86ec --- /dev/null +++ b/arch/sh/include/asm/resource.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_RESOURCE_H | ||
| 2 | #define __ASM_SH_RESOURCE_H | ||
| 3 | |||
| 4 | #include <asm-generic/resource.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_RESOURCE_H */ | ||
diff --git a/arch/sh/include/asm/scatterlist.h b/arch/sh/include/asm/scatterlist.h new file mode 100644 index 00000000000..98dfc3510f1 --- /dev/null +++ b/arch/sh/include/asm/scatterlist.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_SCATTERLIST_H | ||
| 2 | #define __ASM_SH_SCATTERLIST_H | ||
| 3 | |||
| 4 | #include <asm-generic/scatterlist.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_SCATTERLIST_H */ | ||
diff --git a/arch/sh/include/asm/sembuf.h b/arch/sh/include/asm/sembuf.h new file mode 100644 index 00000000000..7673b83cfef --- /dev/null +++ b/arch/sh/include/asm/sembuf.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/sembuf.h> | |||
diff --git a/arch/sh/include/asm/serial.h b/arch/sh/include/asm/serial.h new file mode 100644 index 00000000000..a0cb0caff15 --- /dev/null +++ b/arch/sh/include/asm/serial.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/serial.h> | |||
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h new file mode 100644 index 00000000000..0f325da0f92 --- /dev/null +++ b/arch/sh/include/asm/sh_eth.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef __ASM_SH_ETH_H__ | ||
| 2 | #define __ASM_SH_ETH_H__ | ||
| 3 | |||
| 4 | #include <linux/phy.h> | ||
| 5 | |||
| 6 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; | ||
| 7 | enum { | ||
| 8 | SH_ETH_REG_GIGABIT, | ||
| 9 | SH_ETH_REG_FAST_SH4, | ||
| 10 | SH_ETH_REG_FAST_SH3_SH2 | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct sh_eth_plat_data { | ||
| 14 | int phy; | ||
| 15 | int edmac_endian; | ||
| 16 | int register_type; | ||
| 17 | phy_interface_t phy_interface; | ||
| 18 | void (*set_mdio_gate)(unsigned long addr); | ||
| 19 | |||
| 20 | unsigned char mac_addr[6]; | ||
| 21 | unsigned no_ether_link:1; | ||
| 22 | unsigned ether_link_active_low:1; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/arch/sh/include/asm/shmbuf.h b/arch/sh/include/asm/shmbuf.h new file mode 100644 index 00000000000..83c05fc2de3 --- /dev/null +++ b/arch/sh/include/asm/shmbuf.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/shmbuf.h> | |||
diff --git a/arch/sh/include/asm/sigcontext.h b/arch/sh/include/asm/sigcontext.h new file mode 100644 index 00000000000..8ce1435bc0b --- /dev/null +++ b/arch/sh/include/asm/sigcontext.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #ifndef __ASM_SH_SIGCONTEXT_H | ||
| 2 | #define __ASM_SH_SIGCONTEXT_H | ||
| 3 | |||
| 4 | struct sigcontext { | ||
| 5 | unsigned long oldmask; | ||
| 6 | |||
| 7 | #if defined(__SH5__) || defined(CONFIG_CPU_SH5) | ||
| 8 | /* CPU registers */ | ||
| 9 | unsigned long long sc_regs[63]; | ||
| 10 | unsigned long long sc_tregs[8]; | ||
| 11 | unsigned long long sc_pc; | ||
| 12 | unsigned long long sc_sr; | ||
| 13 | |||
| 14 | /* FPU registers */ | ||
| 15 | unsigned long long sc_fpregs[32]; | ||
| 16 | unsigned int sc_fpscr; | ||
| 17 | unsigned int sc_fpvalid; | ||
| 18 | #else | ||
| 19 | /* CPU registers */ | ||
| 20 | unsigned long sc_regs[16]; | ||
| 21 | unsigned long sc_pc; | ||
| 22 | unsigned long sc_pr; | ||
| 23 | unsigned long sc_sr; | ||
| 24 | unsigned long sc_gbr; | ||
| 25 | unsigned long sc_mach; | ||
| 26 | unsigned long sc_macl; | ||
| 27 | |||
| 28 | #if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \ | ||
| 29 | defined(__SH2A__) || defined(CONFIG_CPU_SH2A) | ||
| 30 | /* FPU registers */ | ||
| 31 | unsigned long sc_fpregs[16]; | ||
| 32 | unsigned long sc_xfpregs[16]; | ||
| 33 | unsigned int sc_fpscr; | ||
| 34 | unsigned int sc_fpul; | ||
| 35 | unsigned int sc_ownedfp; | ||
| 36 | #endif | ||
| 37 | #endif | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif /* __ASM_SH_SIGCONTEXT_H */ | ||
diff --git a/arch/sh/include/asm/siginfo.h b/arch/sh/include/asm/siginfo.h new file mode 100644 index 00000000000..813040ed68a --- /dev/null +++ b/arch/sh/include/asm/siginfo.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_SIGINFO_H | ||
| 2 | #define __ASM_SH_SIGINFO_H | ||
| 3 | |||
| 4 | #include <asm-generic/siginfo.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_SIGINFO_H */ | ||
diff --git a/arch/sh/include/asm/signal.h b/arch/sh/include/asm/signal.h new file mode 100644 index 00000000000..9ac530a90bc --- /dev/null +++ b/arch/sh/include/asm/signal.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef __ASM_SH_SIGNAL_H | ||
| 2 | #define __ASM_SH_SIGNAL_H | ||
| 3 | |||
| 4 | #define SA_RESTORER 0x04000000 | ||
| 5 | |||
| 6 | #include <asm-generic/signal.h> | ||
| 7 | |||
| 8 | struct old_sigaction { | ||
| 9 | __sighandler_t sa_handler; | ||
| 10 | old_sigset_t sa_mask; | ||
| 11 | unsigned long sa_flags; | ||
| 12 | void (*sa_restorer)(void); | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif /* __ASM_SH_SIGNAL_H */ | ||
diff --git a/arch/sh/include/asm/sizes.h b/arch/sh/include/asm/sizes.h new file mode 100644 index 00000000000..dd248c2e108 --- /dev/null +++ b/arch/sh/include/asm/sizes.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/sizes.h> | |||
diff --git a/arch/sh/include/asm/socket.h b/arch/sh/include/asm/socket.h new file mode 100644 index 00000000000..6b71384b9d8 --- /dev/null +++ b/arch/sh/include/asm/socket.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/socket.h> | |||
diff --git a/arch/sh/include/asm/sockios.h b/arch/sh/include/asm/sockios.h new file mode 100644 index 00000000000..cf8b96b1f9a --- /dev/null +++ b/arch/sh/include/asm/sockios.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef __ASM_SH_SOCKIOS_H | ||
| 2 | #define __ASM_SH_SOCKIOS_H | ||
| 3 | |||
| 4 | /* Socket-level I/O control calls. */ | ||
| 5 | #define FIOGETOWN _IOR('f', 123, int) | ||
| 6 | #define FIOSETOWN _IOW('f', 124, int) | ||
| 7 | |||
| 8 | #define SIOCATMARK _IOR('s', 7, int) | ||
| 9 | #define SIOCSPGRP _IOW('s', 8, pid_t) | ||
| 10 | #define SIOCGPGRP _IOR('s', 9, pid_t) | ||
| 11 | |||
| 12 | #define SIOCGSTAMP _IOR('s', 100, struct timeval) /* Get stamp (timeval) */ | ||
| 13 | #define SIOCGSTAMPNS _IOR('s', 101, struct timespec) /* Get stamp (timespec) */ | ||
| 14 | #endif /* __ASM_SH_SOCKIOS_H */ | ||
diff --git a/arch/sh/include/asm/stat.h b/arch/sh/include/asm/stat.h new file mode 100644 index 00000000000..e1810cc6e3d --- /dev/null +++ b/arch/sh/include/asm/stat.h | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | #ifndef __ASM_SH_STAT_H | ||
| 2 | #define __ASM_SH_STAT_H | ||
| 3 | |||
| 4 | struct __old_kernel_stat { | ||
| 5 | unsigned short st_dev; | ||
| 6 | unsigned short st_ino; | ||
| 7 | unsigned short st_mode; | ||
| 8 | unsigned short st_nlink; | ||
| 9 | unsigned short st_uid; | ||
| 10 | unsigned short st_gid; | ||
| 11 | unsigned short st_rdev; | ||
| 12 | unsigned long st_size; | ||
| 13 | unsigned long st_atime; | ||
| 14 | unsigned long st_mtime; | ||
| 15 | unsigned long st_ctime; | ||
| 16 | }; | ||
| 17 | |||
| 18 | #if defined(__SH5__) || defined(CONFIG_CPU_SH5) | ||
| 19 | struct stat { | ||
| 20 | unsigned short st_dev; | ||
| 21 | unsigned short __pad1; | ||
| 22 | unsigned long st_ino; | ||
| 23 | unsigned short st_mode; | ||
| 24 | unsigned short st_nlink; | ||
| 25 | unsigned short st_uid; | ||
| 26 | unsigned short st_gid; | ||
| 27 | unsigned short st_rdev; | ||
| 28 | unsigned short __pad2; | ||
| 29 | unsigned long st_size; | ||
| 30 | unsigned long st_blksize; | ||
| 31 | unsigned long st_blocks; | ||
| 32 | unsigned long st_atime; | ||
| 33 | unsigned long st_atime_nsec; | ||
| 34 | unsigned long st_mtime; | ||
| 35 | unsigned long st_mtime_nsec; | ||
| 36 | unsigned long st_ctime; | ||
| 37 | unsigned long st_ctime_nsec; | ||
| 38 | unsigned long __unused4; | ||
| 39 | unsigned long __unused5; | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* This matches struct stat64 in glibc2.1, hence the absolutely | ||
| 43 | * insane amounts of padding around dev_t's. | ||
| 44 | */ | ||
| 45 | struct stat64 { | ||
| 46 | unsigned short st_dev; | ||
| 47 | unsigned char __pad0[10]; | ||
| 48 | |||
| 49 | unsigned long st_ino; | ||
| 50 | unsigned int st_mode; | ||
| 51 | unsigned int st_nlink; | ||
| 52 | |||
| 53 | unsigned long st_uid; | ||
| 54 | unsigned long st_gid; | ||
| 55 | |||
| 56 | unsigned short st_rdev; | ||
| 57 | unsigned char __pad3[10]; | ||
| 58 | |||
| 59 | long long st_size; | ||
| 60 | unsigned long st_blksize; | ||
| 61 | |||
| 62 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 63 | unsigned long __pad4; /* future possible st_blocks high bits */ | ||
| 64 | |||
| 65 | unsigned long st_atime; | ||
| 66 | unsigned long st_atime_nsec; | ||
| 67 | |||
| 68 | unsigned long st_mtime; | ||
| 69 | unsigned long st_mtime_nsec; | ||
| 70 | |||
| 71 | unsigned long st_ctime; | ||
| 72 | unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */ | ||
| 73 | |||
| 74 | unsigned long __unused1; | ||
| 75 | unsigned long __unused2; | ||
| 76 | }; | ||
| 77 | #else | ||
| 78 | struct stat { | ||
| 79 | unsigned long st_dev; | ||
| 80 | unsigned long st_ino; | ||
| 81 | unsigned short st_mode; | ||
| 82 | unsigned short st_nlink; | ||
| 83 | unsigned short st_uid; | ||
| 84 | unsigned short st_gid; | ||
| 85 | unsigned long st_rdev; | ||
| 86 | unsigned long st_size; | ||
| 87 | unsigned long st_blksize; | ||
| 88 | unsigned long st_blocks; | ||
| 89 | unsigned long st_atime; | ||
| 90 | unsigned long st_atime_nsec; | ||
| 91 | unsigned long st_mtime; | ||
| 92 | unsigned long st_mtime_nsec; | ||
| 93 | unsigned long st_ctime; | ||
| 94 | unsigned long st_ctime_nsec; | ||
| 95 | unsigned long __unused4; | ||
| 96 | unsigned long __unused5; | ||
| 97 | }; | ||
| 98 | |||
| 99 | /* This matches struct stat64 in glibc2.1, hence the absolutely | ||
| 100 | * insane amounts of padding around dev_t's. | ||
| 101 | */ | ||
| 102 | struct stat64 { | ||
| 103 | unsigned long long st_dev; | ||
| 104 | unsigned char __pad0[4]; | ||
| 105 | |||
| 106 | #define STAT64_HAS_BROKEN_ST_INO 1 | ||
| 107 | unsigned long __st_ino; | ||
| 108 | |||
| 109 | unsigned int st_mode; | ||
| 110 | unsigned int st_nlink; | ||
| 111 | |||
| 112 | unsigned long st_uid; | ||
| 113 | unsigned long st_gid; | ||
| 114 | |||
| 115 | unsigned long long st_rdev; | ||
| 116 | unsigned char __pad3[4]; | ||
| 117 | |||
| 118 | long long st_size; | ||
| 119 | unsigned long st_blksize; | ||
| 120 | |||
| 121 | unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 122 | |||
| 123 | unsigned long st_atime; | ||
| 124 | unsigned long st_atime_nsec; | ||
| 125 | |||
| 126 | unsigned long st_mtime; | ||
| 127 | unsigned long st_mtime_nsec; | ||
| 128 | |||
| 129 | unsigned long st_ctime; | ||
| 130 | unsigned long st_ctime_nsec; | ||
| 131 | |||
| 132 | unsigned long long st_ino; | ||
| 133 | }; | ||
| 134 | |||
| 135 | #define STAT_HAVE_NSEC 1 | ||
| 136 | #endif | ||
| 137 | |||
| 138 | #endif /* __ASM_SH_STAT_H */ | ||
diff --git a/arch/sh/include/asm/statfs.h b/arch/sh/include/asm/statfs.h new file mode 100644 index 00000000000..9202a023328 --- /dev/null +++ b/arch/sh/include/asm/statfs.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_STATFS_H | ||
| 2 | #define __ASM_SH_STATFS_H | ||
| 3 | |||
| 4 | #include <asm-generic/statfs.h> | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_STATFS_H */ | ||
diff --git a/arch/sh/include/asm/swab.h b/arch/sh/include/asm/swab.h new file mode 100644 index 00000000000..1cd09767a7a --- /dev/null +++ b/arch/sh/include/asm/swab.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | #ifndef __ASM_SH_SWAB_H | ||
| 2 | #define __ASM_SH_SWAB_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 1999 Niibe Yutaka | ||
| 6 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
| 7 | */ | ||
| 8 | #include <linux/compiler.h> | ||
| 9 | #include <linux/types.h> | ||
| 10 | #include <asm-generic/swab.h> | ||
| 11 | |||
| 12 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | ||
| 13 | { | ||
| 14 | __asm__( | ||
| 15 | #ifdef __SH5__ | ||
| 16 | "byterev %1, %0\n\t" | ||
| 17 | "shari %0, 32, %0" | ||
| 18 | #else | ||
| 19 | "swap.b %1, %0\n\t" | ||
| 20 | "swap.w %0, %0\n\t" | ||
| 21 | "swap.b %0, %0" | ||
| 22 | #endif | ||
| 23 | : "=r" (x) | ||
| 24 | : "r" (x)); | ||
| 25 | |||
| 26 | return x; | ||
| 27 | } | ||
| 28 | #define __arch_swab32 __arch_swab32 | ||
| 29 | |||
| 30 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) | ||
| 31 | { | ||
| 32 | __asm__( | ||
| 33 | #ifdef __SH5__ | ||
| 34 | "byterev %1, %0\n\t" | ||
| 35 | "shari %0, 32, %0" | ||
| 36 | #else | ||
| 37 | "swap.b %1, %0" | ||
| 38 | #endif | ||
| 39 | : "=r" (x) | ||
| 40 | : "r" (x)); | ||
| 41 | |||
| 42 | return x; | ||
| 43 | } | ||
| 44 | #define __arch_swab16 __arch_swab16 | ||
| 45 | |||
| 46 | static inline __u64 __arch_swab64(__u64 val) | ||
| 47 | { | ||
| 48 | union { | ||
| 49 | struct { __u32 a,b; } s; | ||
| 50 | __u64 u; | ||
| 51 | } v, w; | ||
| 52 | v.u = val; | ||
| 53 | w.s.b = __arch_swab32(v.s.a); | ||
| 54 | w.s.a = __arch_swab32(v.s.b); | ||
| 55 | return w.u; | ||
| 56 | } | ||
| 57 | #define __arch_swab64 __arch_swab64 | ||
| 58 | |||
| 59 | #endif /* __ASM_SH_SWAB_H */ | ||
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h new file mode 100644 index 00000000000..10c8b1823a1 --- /dev/null +++ b/arch/sh/include/asm/system.h | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | #ifndef __ASM_SH_SYSTEM_H | ||
| 2 | #define __ASM_SH_SYSTEM_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima | ||
| 6 | * Copyright (C) 2002 Paul Mundt | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <linux/irqflags.h> | ||
| 10 | #include <linux/compiler.h> | ||
| 11 | #include <linux/linkage.h> | ||
| 12 | #include <asm/types.h> | ||
| 13 | #include <asm/uncached.h> | ||
| 14 | |||
| 15 | #define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * A brief note on ctrl_barrier(), the control register write barrier. | ||
| 19 | * | ||
| 20 | * Legacy SH cores typically require a sequence of 8 nops after | ||
| 21 | * modification of a control register in order for the changes to take | ||
| 22 | * effect. On newer cores (like the sh4a and sh5) this is accomplished | ||
| 23 | * with icbi. | ||
| 24 | * | ||
| 25 | * Also note that on sh4a in the icbi case we can forego a synco for the | ||
| 26 | * write barrier, as it's not necessary for control registers. | ||
| 27 | * | ||
| 28 | * Historically we have only done this type of barrier for the MMUCR, but | ||
| 29 | * it's also necessary for the CCR, so we make it generic here instead. | ||
| 30 | */ | ||
| 31 | #if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5) | ||
| 32 | #define mb() __asm__ __volatile__ ("synco": : :"memory") | ||
| 33 | #define rmb() mb() | ||
| 34 | #define wmb() __asm__ __volatile__ ("synco": : :"memory") | ||
| 35 | #define ctrl_barrier() __icbi(PAGE_OFFSET) | ||
| 36 | #define read_barrier_depends() do { } while(0) | ||
| 37 | #else | ||
| 38 | #define mb() __asm__ __volatile__ ("": : :"memory") | ||
| 39 | #define rmb() mb() | ||
| 40 | #define wmb() __asm__ __volatile__ ("": : :"memory") | ||
| 41 | #define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop") | ||
| 42 | #define read_barrier_depends() do { } while(0) | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #ifdef CONFIG_SMP | ||
| 46 | #define smp_mb() mb() | ||
| 47 | #define smp_rmb() rmb() | ||
| 48 | #define smp_wmb() wmb() | ||
| 49 | #define smp_read_barrier_depends() read_barrier_depends() | ||
| 50 | #else | ||
| 51 | #define smp_mb() barrier() | ||
| 52 | #define smp_rmb() barrier() | ||
| 53 | #define smp_wmb() barrier() | ||
| 54 | #define smp_read_barrier_depends() do { } while(0) | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) | ||
| 58 | |||
| 59 | #ifdef CONFIG_GUSA_RB | ||
| 60 | #include <asm/cmpxchg-grb.h> | ||
| 61 | #elif defined(CONFIG_CPU_SH4A) | ||
| 62 | #include <asm/cmpxchg-llsc.h> | ||
| 63 | #else | ||
| 64 | #include <asm/cmpxchg-irq.h> | ||
| 65 | #endif | ||
| 66 | |||
| 67 | extern void __xchg_called_with_bad_pointer(void); | ||
| 68 | |||
| 69 | #define __xchg(ptr, x, size) \ | ||
| 70 | ({ \ | ||
| 71 | unsigned long __xchg__res; \ | ||
| 72 | volatile void *__xchg_ptr = (ptr); \ | ||
| 73 | switch (size) { \ | ||
| 74 | case 4: \ | ||
| 75 | __xchg__res = xchg_u32(__xchg_ptr, x); \ | ||
| 76 | break; \ | ||
| 77 | case 1: \ | ||
| 78 | __xchg__res = xchg_u8(__xchg_ptr, x); \ | ||
| 79 | break; \ | ||
| 80 | default: \ | ||
| 81 | __xchg_called_with_bad_pointer(); \ | ||
| 82 | __xchg__res = x; \ | ||
| 83 | break; \ | ||
| 84 | } \ | ||
| 85 | \ | ||
| 86 | __xchg__res; \ | ||
| 87 | }) | ||
| 88 | |||
| 89 | #define xchg(ptr,x) \ | ||
| 90 | ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)))) | ||
| 91 | |||
| 92 | /* This function doesn't exist, so you'll get a linker error | ||
| 93 | * if something tries to do an invalid cmpxchg(). */ | ||
| 94 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
| 95 | |||
| 96 | #define __HAVE_ARCH_CMPXCHG 1 | ||
| 97 | |||
| 98 | static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, | ||
| 99 | unsigned long new, int size) | ||
| 100 | { | ||
| 101 | switch (size) { | ||
| 102 | case 4: | ||
| 103 | return __cmpxchg_u32(ptr, old, new); | ||
| 104 | } | ||
| 105 | __cmpxchg_called_with_bad_pointer(); | ||
| 106 | return old; | ||
| 107 | } | ||
| 108 | |||
| 109 | #define cmpxchg(ptr,o,n) \ | ||
| 110 | ({ \ | ||
| 111 | __typeof__(*(ptr)) _o_ = (o); \ | ||
| 112 | __typeof__(*(ptr)) _n_ = (n); \ | ||
| 113 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
| 114 | (unsigned long)_n_, sizeof(*(ptr))); \ | ||
| 115 | }) | ||
| 116 | |||
| 117 | struct pt_regs; | ||
| 118 | |||
| 119 | extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); | ||
| 120 | void free_initmem(void); | ||
| 121 | void free_initrd_mem(unsigned long start, unsigned long end); | ||
| 122 | |||
| 123 | extern void *set_exception_table_vec(unsigned int vec, void *handler); | ||
| 124 | |||
| 125 | static inline void *set_exception_table_evt(unsigned int evt, void *handler) | ||
| 126 | { | ||
| 127 | return set_exception_table_vec(evt >> 5, handler); | ||
| 128 | } | ||
| 129 | |||
| 130 | /* | ||
| 131 | * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks. | ||
| 132 | */ | ||
| 133 | #ifdef CONFIG_CPU_SH2A | ||
| 134 | extern unsigned int instruction_size(unsigned int insn); | ||
| 135 | #elif defined(CONFIG_SUPERH32) | ||
| 136 | #define instruction_size(insn) (2) | ||
| 137 | #else | ||
| 138 | #define instruction_size(insn) (4) | ||
| 139 | #endif | ||
| 140 | |||
| 141 | void per_cpu_trap_init(void); | ||
| 142 | void default_idle(void); | ||
| 143 | void cpu_idle_wait(void); | ||
| 144 | void stop_this_cpu(void *); | ||
| 145 | |||
| 146 | #ifdef CONFIG_SUPERH32 | ||
| 147 | #define BUILD_TRAP_HANDLER(name) \ | ||
| 148 | asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \ | ||
| 149 | unsigned long r6, unsigned long r7, \ | ||
| 150 | struct pt_regs __regs) | ||
| 151 | |||
| 152 | #define TRAP_HANDLER_DECL \ | ||
| 153 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \ | ||
| 154 | unsigned int vec = regs->tra; \ | ||
| 155 | (void)vec; | ||
| 156 | #else | ||
| 157 | #define BUILD_TRAP_HANDLER(name) \ | ||
| 158 | asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs) | ||
| 159 | #define TRAP_HANDLER_DECL | ||
| 160 | #endif | ||
| 161 | |||
| 162 | BUILD_TRAP_HANDLER(address_error); | ||
| 163 | BUILD_TRAP_HANDLER(debug); | ||
| 164 | BUILD_TRAP_HANDLER(bug); | ||
| 165 | BUILD_TRAP_HANDLER(breakpoint); | ||
| 166 | BUILD_TRAP_HANDLER(singlestep); | ||
| 167 | BUILD_TRAP_HANDLER(fpu_error); | ||
| 168 | BUILD_TRAP_HANDLER(fpu_state_restore); | ||
| 169 | BUILD_TRAP_HANDLER(nmi); | ||
| 170 | |||
| 171 | #define arch_align_stack(x) (x) | ||
| 172 | |||
| 173 | struct mem_access { | ||
| 174 | unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt); | ||
| 175 | unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt); | ||
| 176 | }; | ||
| 177 | |||
| 178 | #ifdef CONFIG_SUPERH32 | ||
| 179 | # include "system_32.h" | ||
| 180 | #else | ||
| 181 | # include "system_64.h" | ||
| 182 | #endif | ||
| 183 | |||
| 184 | #endif | ||
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h new file mode 100644 index 00000000000..a4ad1cd9bc4 --- /dev/null +++ b/arch/sh/include/asm/system_32.h | |||
| @@ -0,0 +1,236 @@ | |||
| 1 | #ifndef __ASM_SH_SYSTEM_32_H | ||
| 2 | #define __ASM_SH_SYSTEM_32_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <asm/mmu.h> | ||
| 6 | |||
| 7 | #ifdef CONFIG_SH_DSP | ||
| 8 | |||
| 9 | #define is_dsp_enabled(tsk) \ | ||
| 10 | (!!(tsk->thread.dsp_status.status & SR_DSP)) | ||
| 11 | |||
| 12 | #define __restore_dsp(tsk) \ | ||
| 13 | do { \ | ||
| 14 | register u32 *__ts2 __asm__ ("r2") = \ | ||
| 15 | (u32 *)&tsk->thread.dsp_status; \ | ||
| 16 | __asm__ __volatile__ ( \ | ||
| 17 | ".balign 4\n\t" \ | ||
| 18 | "movs.l @r2+, a0\n\t" \ | ||
| 19 | "movs.l @r2+, a1\n\t" \ | ||
| 20 | "movs.l @r2+, a0g\n\t" \ | ||
| 21 | "movs.l @r2+, a1g\n\t" \ | ||
| 22 | "movs.l @r2+, m0\n\t" \ | ||
| 23 | "movs.l @r2+, m1\n\t" \ | ||
| 24 | "movs.l @r2+, x0\n\t" \ | ||
| 25 | "movs.l @r2+, x1\n\t" \ | ||
| 26 | "movs.l @r2+, y0\n\t" \ | ||
| 27 | "movs.l @r2+, y1\n\t" \ | ||
| 28 | "lds.l @r2+, dsr\n\t" \ | ||
| 29 | "ldc.l @r2+, rs\n\t" \ | ||
| 30 | "ldc.l @r2+, re\n\t" \ | ||
| 31 | "ldc.l @r2+, mod\n\t" \ | ||
| 32 | : : "r" (__ts2)); \ | ||
| 33 | } while (0) | ||
| 34 | |||
| 35 | |||
| 36 | #define __save_dsp(tsk) \ | ||
| 37 | do { \ | ||
| 38 | register u32 *__ts2 __asm__ ("r2") = \ | ||
| 39 | (u32 *)&tsk->thread.dsp_status + 14; \ | ||
| 40 | \ | ||
| 41 | __asm__ __volatile__ ( \ | ||
| 42 | ".balign 4\n\t" \ | ||
| 43 | "stc.l mod, @-r2\n\t" \ | ||
| 44 | "stc.l re, @-r2\n\t" \ | ||
| 45 | "stc.l rs, @-r2\n\t" \ | ||
| 46 | "sts.l dsr, @-r2\n\t" \ | ||
| 47 | "movs.l y1, @-r2\n\t" \ | ||
| 48 | "movs.l y0, @-r2\n\t" \ | ||
| 49 | "movs.l x1, @-r2\n\t" \ | ||
| 50 | "movs.l x0, @-r2\n\t" \ | ||
| 51 | "movs.l m1, @-r2\n\t" \ | ||
| 52 | "movs.l m0, @-r2\n\t" \ | ||
| 53 | "movs.l a1g, @-r2\n\t" \ | ||
| 54 | "movs.l a0g, @-r2\n\t" \ | ||
| 55 | "movs.l a1, @-r2\n\t" \ | ||
| 56 | "movs.l a0, @-r2\n\t" \ | ||
| 57 | : : "r" (__ts2)); \ | ||
| 58 | } while (0) | ||
| 59 | |||
| 60 | #else | ||
| 61 | |||
| 62 | #define is_dsp_enabled(tsk) (0) | ||
| 63 | #define __save_dsp(tsk) do { } while (0) | ||
| 64 | #define __restore_dsp(tsk) do { } while (0) | ||
| 65 | #endif | ||
| 66 | |||
| 67 | #if defined(CONFIG_CPU_SH4A) | ||
| 68 | #define __icbi(addr) __asm__ __volatile__ ( "icbi @%0\n\t" : : "r" (addr)) | ||
| 69 | #else | ||
| 70 | #define __icbi(addr) mb() | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #define __ocbp(addr) __asm__ __volatile__ ( "ocbp @%0\n\t" : : "r" (addr)) | ||
| 74 | #define __ocbi(addr) __asm__ __volatile__ ( "ocbi @%0\n\t" : : "r" (addr)) | ||
| 75 | #define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb @%0\n\t" : : "r" (addr)) | ||
| 76 | |||
| 77 | struct task_struct *__switch_to(struct task_struct *prev, | ||
| 78 | struct task_struct *next); | ||
| 79 | |||
| 80 | /* | ||
| 81 | * switch_to() should switch tasks to task nr n, first | ||
| 82 | */ | ||
| 83 | #define switch_to(prev, next, last) \ | ||
| 84 | do { \ | ||
| 85 | register u32 *__ts1 __asm__ ("r1"); \ | ||
| 86 | register u32 *__ts2 __asm__ ("r2"); \ | ||
| 87 | register u32 *__ts4 __asm__ ("r4"); \ | ||
| 88 | register u32 *__ts5 __asm__ ("r5"); \ | ||
| 89 | register u32 *__ts6 __asm__ ("r6"); \ | ||
| 90 | register u32 __ts7 __asm__ ("r7"); \ | ||
| 91 | struct task_struct *__last; \ | ||
| 92 | \ | ||
| 93 | if (is_dsp_enabled(prev)) \ | ||
| 94 | __save_dsp(prev); \ | ||
| 95 | \ | ||
| 96 | __ts1 = (u32 *)&prev->thread.sp; \ | ||
| 97 | __ts2 = (u32 *)&prev->thread.pc; \ | ||
| 98 | __ts4 = (u32 *)prev; \ | ||
| 99 | __ts5 = (u32 *)next; \ | ||
| 100 | __ts6 = (u32 *)&next->thread.sp; \ | ||
| 101 | __ts7 = next->thread.pc; \ | ||
| 102 | \ | ||
| 103 | __asm__ __volatile__ ( \ | ||
| 104 | ".balign 4\n\t" \ | ||
| 105 | "stc.l gbr, @-r15\n\t" \ | ||
| 106 | "sts.l pr, @-r15\n\t" \ | ||
| 107 | "mov.l r8, @-r15\n\t" \ | ||
| 108 | "mov.l r9, @-r15\n\t" \ | ||
| 109 | "mov.l r10, @-r15\n\t" \ | ||
| 110 | "mov.l r11, @-r15\n\t" \ | ||
| 111 | "mov.l r12, @-r15\n\t" \ | ||
| 112 | "mov.l r13, @-r15\n\t" \ | ||
| 113 | "mov.l r14, @-r15\n\t" \ | ||
| 114 | "mov.l r15, @r1\t! save SP\n\t" \ | ||
| 115 | "mov.l @r6, r15\t! change to new stack\n\t" \ | ||
| 116 | "mova 1f, %0\n\t" \ | ||
| 117 | "mov.l %0, @r2\t! save PC\n\t" \ | ||
| 118 | "mov.l 2f, %0\n\t" \ | ||
| 119 | "jmp @%0\t! call __switch_to\n\t" \ | ||
| 120 | " lds r7, pr\t! with return to new PC\n\t" \ | ||
| 121 | ".balign 4\n" \ | ||
| 122 | "2:\n\t" \ | ||
| 123 | ".long __switch_to\n" \ | ||
| 124 | "1:\n\t" \ | ||
| 125 | "mov.l @r15+, r14\n\t" \ | ||
| 126 | "mov.l @r15+, r13\n\t" \ | ||
| 127 | "mov.l @r15+, r12\n\t" \ | ||
| 128 | "mov.l @r15+, r11\n\t" \ | ||
| 129 | "mov.l @r15+, r10\n\t" \ | ||
| 130 | "mov.l @r15+, r9\n\t" \ | ||
| 131 | "mov.l @r15+, r8\n\t" \ | ||
| 132 | "lds.l @r15+, pr\n\t" \ | ||
| 133 | "ldc.l @r15+, gbr\n\t" \ | ||
| 134 | : "=z" (__last) \ | ||
| 135 | : "r" (__ts1), "r" (__ts2), "r" (__ts4), \ | ||
| 136 | "r" (__ts5), "r" (__ts6), "r" (__ts7) \ | ||
| 137 | : "r3", "t"); \ | ||
| 138 | \ | ||
| 139 | last = __last; \ | ||
| 140 | } while (0) | ||
| 141 | |||
| 142 | #define finish_arch_switch(prev) \ | ||
| 143 | do { \ | ||
| 144 | if (is_dsp_enabled(prev)) \ | ||
| 145 | __restore_dsp(prev); \ | ||
| 146 | } while (0) | ||
| 147 | |||
| 148 | #ifdef CONFIG_CPU_HAS_SR_RB | ||
| 149 | #define lookup_exception_vector() \ | ||
| 150 | ({ \ | ||
| 151 | unsigned long _vec; \ | ||
| 152 | \ | ||
| 153 | __asm__ __volatile__ ( \ | ||
| 154 | "stc r2_bank, %0\n\t" \ | ||
| 155 | : "=r" (_vec) \ | ||
| 156 | ); \ | ||
| 157 | \ | ||
| 158 | _vec; \ | ||
| 159 | }) | ||
| 160 | #else | ||
| 161 | #define lookup_exception_vector() \ | ||
| 162 | ({ \ | ||
| 163 | unsigned long _vec; \ | ||
| 164 | __asm__ __volatile__ ( \ | ||
| 165 | "mov r4, %0\n\t" \ | ||
| 166 | : "=r" (_vec) \ | ||
| 167 | ); \ | ||
| 168 | \ | ||
| 169 | _vec; \ | ||
| 170 | }) | ||
| 171 | #endif | ||
| 172 | |||
| 173 | static inline reg_size_t register_align(void *val) | ||
| 174 | { | ||
| 175 | return (unsigned long)(signed long)val; | ||
| 176 | } | ||
| 177 | |||
| 178 | int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | ||
| 179 | struct mem_access *ma, int, unsigned long address); | ||
| 180 | |||
| 181 | static inline void trigger_address_error(void) | ||
| 182 | { | ||
| 183 | __asm__ __volatile__ ( | ||
| 184 | "ldc %0, sr\n\t" | ||
| 185 | "mov.l @%1, %0" | ||
| 186 | : | ||
| 187 | : "r" (0x10000000), "r" (0x80000001) | ||
| 188 | ); | ||
| 189 | } | ||
| 190 | |||
| 191 | asmlinkage void do_address_error(struct pt_regs *regs, | ||
| 192 | unsigned long writeaccess, | ||
| 193 | unsigned long address); | ||
| 194 | asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, | ||
| 195 | unsigned long r6, unsigned long r7, | ||
| 196 | struct pt_regs __regs); | ||
| 197 | asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, | ||
| 198 | unsigned long r6, unsigned long r7, | ||
| 199 | struct pt_regs __regs); | ||
| 200 | asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5, | ||
| 201 | unsigned long r6, unsigned long r7, | ||
| 202 | struct pt_regs __regs); | ||
| 203 | asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, | ||
| 204 | unsigned long r6, unsigned long r7, | ||
| 205 | struct pt_regs __regs); | ||
| 206 | |||
| 207 | static inline void set_bl_bit(void) | ||
| 208 | { | ||
| 209 | unsigned long __dummy0, __dummy1; | ||
| 210 | |||
| 211 | __asm__ __volatile__ ( | ||
| 212 | "stc sr, %0\n\t" | ||
| 213 | "or %2, %0\n\t" | ||
| 214 | "and %3, %0\n\t" | ||
| 215 | "ldc %0, sr\n\t" | ||
| 216 | : "=&r" (__dummy0), "=r" (__dummy1) | ||
| 217 | : "r" (0x10000000), "r" (0xffffff0f) | ||
| 218 | : "memory" | ||
| 219 | ); | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline void clear_bl_bit(void) | ||
| 223 | { | ||
| 224 | unsigned long __dummy0, __dummy1; | ||
| 225 | |||
| 226 | __asm__ __volatile__ ( | ||
| 227 | "stc sr, %0\n\t" | ||
| 228 | "and %2, %0\n\t" | ||
| 229 | "ldc %0, sr\n\t" | ||
| 230 | : "=&r" (__dummy0), "=r" (__dummy1) | ||
| 231 | : "1" (~0x10000000) | ||
| 232 | : "memory" | ||
| 233 | ); | ||
| 234 | } | ||
| 235 | |||
| 236 | #endif /* __ASM_SH_SYSTEM_32_H */ | ||
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h new file mode 100644 index 00000000000..8593bc8d1a4 --- /dev/null +++ b/arch/sh/include/asm/system_64.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | #ifndef __ASM_SH_SYSTEM_64_H | ||
| 2 | #define __ASM_SH_SYSTEM_64_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * include/asm-sh/system_64.h | ||
| 6 | * | ||
| 7 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
| 8 | * Copyright (C) 2003 Paul Mundt | ||
| 9 | * Copyright (C) 2004 Richard Curnow | ||
| 10 | * | ||
| 11 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 12 | * License. See the file "COPYING" in the main directory of this archive | ||
| 13 | * for more details. | ||
| 14 | */ | ||
| 15 | #include <cpu/registers.h> | ||
| 16 | #include <asm/processor.h> | ||
| 17 | |||
| 18 | /* | ||
| 19 | * switch_to() should switch tasks to task nr n, first | ||
| 20 | */ | ||
| 21 | struct thread_struct; | ||
| 22 | struct task_struct *sh64_switch_to(struct task_struct *prev, | ||
| 23 | struct thread_struct *prev_thread, | ||
| 24 | struct task_struct *next, | ||
| 25 | struct thread_struct *next_thread); | ||
| 26 | |||
| 27 | #define switch_to(prev,next,last) \ | ||
| 28 | do { \ | ||
| 29 | if (last_task_used_math != next) { \ | ||
| 30 | struct pt_regs *regs = next->thread.uregs; \ | ||
| 31 | if (regs) regs->sr |= SR_FD; \ | ||
| 32 | } \ | ||
| 33 | last = sh64_switch_to(prev, &prev->thread, next, \ | ||
| 34 | &next->thread); \ | ||
| 35 | } while (0) | ||
| 36 | |||
| 37 | #define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr)) | ||
| 38 | #define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr)) | ||
| 39 | #define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr)) | ||
| 40 | #define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb %0, 0\n\t" : : "r" (addr)) | ||
| 41 | |||
| 42 | static inline reg_size_t register_align(void *val) | ||
| 43 | { | ||
| 44 | return (unsigned long long)(signed long long)(signed long)val; | ||
| 45 | } | ||
| 46 | |||
| 47 | extern void phys_stext(void); | ||
| 48 | |||
| 49 | static inline void trigger_address_error(void) | ||
| 50 | { | ||
| 51 | phys_stext(); | ||
| 52 | } | ||
| 53 | |||
| 54 | #define SR_BL_LL 0x0000000010000000LL | ||
| 55 | |||
| 56 | static inline void set_bl_bit(void) | ||
| 57 | { | ||
| 58 | unsigned long long __dummy0, __dummy1 = SR_BL_LL; | ||
| 59 | |||
| 60 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
| 61 | "or %0, %1, %0\n\t" | ||
| 62 | "putcon %0, " __SR "\n\t" | ||
| 63 | : "=&r" (__dummy0) | ||
| 64 | : "r" (__dummy1)); | ||
| 65 | |||
| 66 | } | ||
| 67 | |||
| 68 | static inline void clear_bl_bit(void) | ||
| 69 | { | ||
| 70 | unsigned long long __dummy0, __dummy1 = ~SR_BL_LL; | ||
| 71 | |||
| 72 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
| 73 | "and %0, %1, %0\n\t" | ||
| 74 | "putcon %0, " __SR "\n\t" | ||
| 75 | : "=&r" (__dummy0) | ||
| 76 | : "r" (__dummy1)); | ||
| 77 | } | ||
| 78 | |||
| 79 | #endif /* __ASM_SH_SYSTEM_64_H */ | ||
diff --git a/arch/sh/include/asm/termbits.h b/arch/sh/include/asm/termbits.h new file mode 100644 index 00000000000..3935b106de7 --- /dev/null +++ b/arch/sh/include/asm/termbits.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/termbits.h> | |||
diff --git a/arch/sh/include/asm/termios.h b/arch/sh/include/asm/termios.h new file mode 100644 index 00000000000..280d78a9d96 --- /dev/null +++ b/arch/sh/include/asm/termios.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/termios.h> | |||
diff --git a/arch/sh/include/asm/ucontext.h b/arch/sh/include/asm/ucontext.h new file mode 100644 index 00000000000..9bc07b9f30f --- /dev/null +++ b/arch/sh/include/asm/ucontext.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/ucontext.h> | |||
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h new file mode 100644 index 00000000000..3432008d288 --- /dev/null +++ b/arch/sh/include/asm/unistd_32.h | |||
| @@ -0,0 +1,420 @@ | |||
| 1 | #ifndef __ASM_SH_UNISTD_H | ||
| 2 | #define __ASM_SH_UNISTD_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 1999 Niibe Yutaka | ||
| 6 | */ | ||
| 7 | |||
| 8 | /* | ||
| 9 | * This file contains the system call numbers. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #define __NR_restart_syscall 0 | ||
| 13 | #define __NR_exit 1 | ||
| 14 | #define __NR_fork 2 | ||
| 15 | #define __NR_read 3 | ||
| 16 | #define __NR_write 4 | ||
| 17 | #define __NR_open 5 | ||
| 18 | #define __NR_close 6 | ||
| 19 | #define __NR_waitpid 7 | ||
| 20 | #define __NR_creat 8 | ||
| 21 | #define __NR_link 9 | ||
| 22 | #define __NR_unlink 10 | ||
| 23 | #define __NR_execve 11 | ||
| 24 | #define __NR_chdir 12 | ||
| 25 | #define __NR_time 13 | ||
| 26 | #define __NR_mknod 14 | ||
| 27 | #define __NR_chmod 15 | ||
| 28 | #define __NR_lchown 16 | ||
| 29 | #define __NR_break 17 | ||
| 30 | #define __NR_oldstat 18 | ||
| 31 | #define __NR_lseek 19 | ||
| 32 | #define __NR_getpid 20 | ||
| 33 | #define __NR_mount 21 | ||
| 34 | #define __NR_umount 22 | ||
| 35 | #define __NR_setuid 23 | ||
| 36 | #define __NR_getuid 24 | ||
| 37 | #define __NR_stime 25 | ||
| 38 | #define __NR_ptrace 26 | ||
| 39 | #define __NR_alarm 27 | ||
| 40 | #define __NR_oldfstat 28 | ||
| 41 | #define __NR_pause 29 | ||
| 42 | #define __NR_utime 30 | ||
| 43 | #define __NR_stty 31 | ||
| 44 | #define __NR_gtty 32 | ||
| 45 | #define __NR_access 33 | ||
| 46 | #define __NR_nice 34 | ||
| 47 | #define __NR_ftime 35 | ||
| 48 | #define __NR_sync 36 | ||
| 49 | #define __NR_kill 37 | ||
| 50 | #define __NR_rename 38 | ||
| 51 | #define __NR_mkdir 39 | ||
| 52 | #define __NR_rmdir 40 | ||
| 53 | #define __NR_dup 41 | ||
| 54 | #define __NR_pipe 42 | ||
| 55 | #define __NR_times 43 | ||
| 56 | #define __NR_prof 44 | ||
| 57 | #define __NR_brk 45 | ||
| 58 | #define __NR_setgid 46 | ||
| 59 | #define __NR_getgid 47 | ||
| 60 | #define __NR_signal 48 | ||
| 61 | #define __NR_geteuid 49 | ||
| 62 | #define __NR_getegid 50 | ||
| 63 | #define __NR_acct 51 | ||
| 64 | #define __NR_umount2 52 | ||
| 65 | #define __NR_lock 53 | ||
| 66 | #define __NR_ioctl 54 | ||
| 67 | #define __NR_fcntl 55 | ||
| 68 | #define __NR_mpx 56 | ||
| 69 | #define __NR_setpgid 57 | ||
| 70 | #define __NR_ulimit 58 | ||
| 71 | #define __NR_oldolduname 59 | ||
| 72 | #define __NR_umask 60 | ||
| 73 | #define __NR_chroot 61 | ||
| 74 | #define __NR_ustat 62 | ||
| 75 | #define __NR_dup2 63 | ||
| 76 | #define __NR_getppid 64 | ||
| 77 | #define __NR_getpgrp 65 | ||
| 78 | #define __NR_setsid 66 | ||
| 79 | #define __NR_sigaction 67 | ||
| 80 | #define __NR_sgetmask 68 | ||
| 81 | #define __NR_ssetmask 69 | ||
| 82 | #define __NR_setreuid 70 | ||
| 83 | #define __NR_setregid 71 | ||
| 84 | #define __NR_sigsuspend 72 | ||
| 85 | #define __NR_sigpending 73 | ||
| 86 | #define __NR_sethostname 74 | ||
| 87 | #define __NR_setrlimit 75 | ||
| 88 | #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | ||
| 89 | #define __NR_getrusage 77 | ||
| 90 | #define __NR_gettimeofday 78 | ||
| 91 | #define __NR_settimeofday 79 | ||
| 92 | #define __NR_getgroups 80 | ||
| 93 | #define __NR_setgroups 81 | ||
| 94 | #define __NR_select 82 | ||
| 95 | #define __NR_symlink 83 | ||
| 96 | #define __NR_oldlstat 84 | ||
| 97 | #define __NR_readlink 85 | ||
| 98 | #define __NR_uselib 86 | ||
| 99 | #define __NR_swapon 87 | ||
| 100 | #define __NR_reboot 88 | ||
| 101 | #define __NR_readdir 89 | ||
| 102 | #define __NR_mmap 90 | ||
| 103 | #define __NR_munmap 91 | ||
| 104 | #define __NR_truncate 92 | ||
| 105 | #define __NR_ftruncate 93 | ||
| 106 | #define __NR_fchmod 94 | ||
| 107 | #define __NR_fchown 95 | ||
| 108 | #define __NR_getpriority 96 | ||
| 109 | #define __NR_setpriority 97 | ||
| 110 | #define __NR_profil 98 | ||
| 111 | #define __NR_statfs 99 | ||
| 112 | #define __NR_fstatfs 100 | ||
| 113 | #define __NR_ioperm 101 | ||
| 114 | #define __NR_socketcall 102 | ||
| 115 | #define __NR_syslog 103 | ||
| 116 | #define __NR_setitimer 104 | ||
| 117 | #define __NR_getitimer 105 | ||
| 118 | #define __NR_stat 106 | ||
| 119 | #define __NR_lstat 107 | ||
| 120 | #define __NR_fstat 108 | ||
| 121 | #define __NR_olduname 109 | ||
| 122 | #define __NR_iopl 110 | ||
| 123 | #define __NR_vhangup 111 | ||
| 124 | #define __NR_idle 112 | ||
| 125 | #define __NR_vm86old 113 | ||
| 126 | #define __NR_wait4 114 | ||
| 127 | #define __NR_swapoff 115 | ||
| 128 | #define __NR_sysinfo 116 | ||
| 129 | #define __NR_ipc 117 | ||
| 130 | #define __NR_fsync 118 | ||
| 131 | #define __NR_sigreturn 119 | ||
| 132 | #define __NR_clone 120 | ||
| 133 | #define __NR_setdomainname 121 | ||
| 134 | #define __NR_uname 122 | ||
| 135 | #define __NR_cacheflush 123 | ||
| 136 | #define __NR_adjtimex 124 | ||
| 137 | #define __NR_mprotect 125 | ||
| 138 | #define __NR_sigprocmask 126 | ||
| 139 | #define __NR_create_module 127 | ||
| 140 | #define __NR_init_module 128 | ||
| 141 | #define __NR_delete_module 129 | ||
| 142 | #define __NR_get_kernel_syms 130 | ||
| 143 | #define __NR_quotactl 131 | ||
| 144 | #define __NR_getpgid 132 | ||
| 145 | #define __NR_fchdir 133 | ||
| 146 | #define __NR_bdflush 134 | ||
| 147 | #define __NR_sysfs 135 | ||
| 148 | #define __NR_personality 136 | ||
| 149 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
| 150 | #define __NR_setfsuid 138 | ||
| 151 | #define __NR_setfsgid 139 | ||
| 152 | #define __NR__llseek 140 | ||
| 153 | #define __NR_getdents 141 | ||
| 154 | #define __NR__newselect 142 | ||
| 155 | #define __NR_flock 143 | ||
| 156 | #define __NR_msync 144 | ||
| 157 | #define __NR_readv 145 | ||
| 158 | #define __NR_writev 146 | ||
| 159 | #define __NR_getsid 147 | ||
| 160 | #define __NR_fdatasync 148 | ||
| 161 | #define __NR__sysctl 149 | ||
| 162 | #define __NR_mlock 150 | ||
| 163 | #define __NR_munlock 151 | ||
| 164 | #define __NR_mlockall 152 | ||
| 165 | #define __NR_munlockall 153 | ||
| 166 | #define __NR_sched_setparam 154 | ||
| 167 | #define __NR_sched_getparam 155 | ||
| 168 | #define __NR_sched_setscheduler 156 | ||
| 169 | #define __NR_sched_getscheduler 157 | ||
| 170 | #define __NR_sched_yield 158 | ||
| 171 | #define __NR_sched_get_priority_max 159 | ||
| 172 | #define __NR_sched_get_priority_min 160 | ||
| 173 | #define __NR_sched_rr_get_interval 161 | ||
| 174 | #define __NR_nanosleep 162 | ||
| 175 | #define __NR_mremap 163 | ||
| 176 | #define __NR_setresuid 164 | ||
| 177 | #define __NR_getresuid 165 | ||
| 178 | #define __NR_vm86 166 | ||
| 179 | #define __NR_query_module 167 | ||
| 180 | #define __NR_poll 168 | ||
| 181 | #define __NR_nfsservctl 169 | ||
| 182 | #define __NR_setresgid 170 | ||
| 183 | #define __NR_getresgid 171 | ||
| 184 | #define __NR_prctl 172 | ||
| 185 | #define __NR_rt_sigreturn 173 | ||
| 186 | #define __NR_rt_sigaction 174 | ||
| 187 | #define __NR_rt_sigprocmask 175 | ||
| 188 | #define __NR_rt_sigpending 176 | ||
| 189 | #define __NR_rt_sigtimedwait 177 | ||
| 190 | #define __NR_rt_sigqueueinfo 178 | ||
| 191 | #define __NR_rt_sigsuspend 179 | ||
| 192 | #define __NR_pread64 180 | ||
| 193 | #define __NR_pwrite64 181 | ||
| 194 | #define __NR_chown 182 | ||
| 195 | #define __NR_getcwd 183 | ||
| 196 | #define __NR_capget 184 | ||
| 197 | #define __NR_capset 185 | ||
| 198 | #define __NR_sigaltstack 186 | ||
| 199 | #define __NR_sendfile 187 | ||
| 200 | #define __NR_streams1 188 /* some people actually want it */ | ||
| 201 | #define __NR_streams2 189 /* some people actually want it */ | ||
| 202 | #define __NR_vfork 190 | ||
| 203 | #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ | ||
| 204 | #define __NR_mmap2 192 | ||
| 205 | #define __NR_truncate64 193 | ||
| 206 | #define __NR_ftruncate64 194 | ||
| 207 | #define __NR_stat64 195 | ||
| 208 | #define __NR_lstat64 196 | ||
| 209 | #define __NR_fstat64 197 | ||
| 210 | #define __NR_lchown32 198 | ||
| 211 | #define __NR_getuid32 199 | ||
| 212 | #define __NR_getgid32 200 | ||
| 213 | #define __NR_geteuid32 201 | ||
| 214 | #define __NR_getegid32 202 | ||
| 215 | #define __NR_setreuid32 203 | ||
| 216 | #define __NR_setregid32 204 | ||
| 217 | #define __NR_getgroups32 205 | ||
| 218 | #define __NR_setgroups32 206 | ||
| 219 | #define __NR_fchown32 207 | ||
| 220 | #define __NR_setresuid32 208 | ||
| 221 | #define __NR_getresuid32 209 | ||
| 222 | #define __NR_setresgid32 210 | ||
| 223 | #define __NR_getresgid32 211 | ||
| 224 | #define __NR_chown32 212 | ||
| 225 | #define __NR_setuid32 213 | ||
| 226 | #define __NR_setgid32 214 | ||
| 227 | #define __NR_setfsuid32 215 | ||
| 228 | #define __NR_setfsgid32 216 | ||
| 229 | #define __NR_pivot_root 217 | ||
| 230 | #define __NR_mincore 218 | ||
| 231 | #define __NR_madvise 219 | ||
| 232 | #define __NR_getdents64 220 | ||
| 233 | #define __NR_fcntl64 221 | ||
| 234 | /* 223 is unused */ | ||
| 235 | #define __NR_gettid 224 | ||
| 236 | #define __NR_readahead 225 | ||
| 237 | #define __NR_setxattr 226 | ||
| 238 | #define __NR_lsetxattr 227 | ||
| 239 | #define __NR_fsetxattr 228 | ||
| 240 | #define __NR_getxattr 229 | ||
| 241 | #define __NR_lgetxattr 230 | ||
| 242 | #define __NR_fgetxattr 231 | ||
| 243 | #define __NR_listxattr 232 | ||
| 244 | #define __NR_llistxattr 233 | ||
| 245 | #define __NR_flistxattr 234 | ||
| 246 | #define __NR_removexattr 235 | ||
| 247 | #define __NR_lremovexattr 236 | ||
| 248 | #define __NR_fremovexattr 237 | ||
| 249 | #define __NR_tkill 238 | ||
| 250 | #define __NR_sendfile64 239 | ||
| 251 | #define __NR_futex 240 | ||
| 252 | #define __NR_sched_setaffinity 241 | ||
| 253 | #define __NR_sched_getaffinity 242 | ||
| 254 | #define __NR_set_thread_area 243 | ||
| 255 | #define __NR_get_thread_area 244 | ||
| 256 | #define __NR_io_setup 245 | ||
| 257 | #define __NR_io_destroy 246 | ||
| 258 | #define __NR_io_getevents 247 | ||
| 259 | #define __NR_io_submit 248 | ||
| 260 | #define __NR_io_cancel 249 | ||
| 261 | #define __NR_fadvise64 250 | ||
| 262 | |||
| 263 | #define __NR_exit_group 252 | ||
| 264 | #define __NR_lookup_dcookie 253 | ||
| 265 | #define __NR_epoll_create 254 | ||
| 266 | #define __NR_epoll_ctl 255 | ||
| 267 | #define __NR_epoll_wait 256 | ||
| 268 | #define __NR_remap_file_pages 257 | ||
| 269 | #define __NR_set_tid_address 258 | ||
| 270 | #define __NR_timer_create 259 | ||
| 271 | #define __NR_timer_settime (__NR_timer_create+1) | ||
| 272 | #define __NR_timer_gettime (__NR_timer_create+2) | ||
| 273 | #define __NR_timer_getoverrun (__NR_timer_create+3) | ||
| 274 | #define __NR_timer_delete (__NR_timer_create+4) | ||
| 275 | #define __NR_clock_settime (__NR_timer_create+5) | ||
| 276 | #define __NR_clock_gettime (__NR_timer_create+6) | ||
| 277 | #define __NR_clock_getres (__NR_timer_create+7) | ||
| 278 | #define __NR_clock_nanosleep (__NR_timer_create+8) | ||
| 279 | #define __NR_statfs64 268 | ||
| 280 | #define __NR_fstatfs64 269 | ||
| 281 | #define __NR_tgkill 270 | ||
| 282 | #define __NR_utimes 271 | ||
| 283 | #define __NR_fadvise64_64 272 | ||
| 284 | #define __NR_vserver 273 | ||
| 285 | #define __NR_mbind 274 | ||
| 286 | #define __NR_get_mempolicy 275 | ||
| 287 | #define __NR_set_mempolicy 276 | ||
| 288 | #define __NR_mq_open 277 | ||
| 289 | #define __NR_mq_unlink (__NR_mq_open+1) | ||
| 290 | #define __NR_mq_timedsend (__NR_mq_open+2) | ||
| 291 | #define __NR_mq_timedreceive (__NR_mq_open+3) | ||
| 292 | #define __NR_mq_notify (__NR_mq_open+4) | ||
| 293 | #define __NR_mq_getsetattr (__NR_mq_open+5) | ||
| 294 | #define __NR_kexec_load 283 | ||
| 295 | #define __NR_waitid 284 | ||
| 296 | #define __NR_add_key 285 | ||
| 297 | #define __NR_request_key 286 | ||
| 298 | #define __NR_keyctl 287 | ||
| 299 | #define __NR_ioprio_set 288 | ||
| 300 | #define __NR_ioprio_get 289 | ||
| 301 | #define __NR_inotify_init 290 | ||
| 302 | #define __NR_inotify_add_watch 291 | ||
| 303 | #define __NR_inotify_rm_watch 292 | ||
| 304 | /* 293 is unused */ | ||
| 305 | #define __NR_migrate_pages 294 | ||
| 306 | #define __NR_openat 295 | ||
| 307 | #define __NR_mkdirat 296 | ||
| 308 | #define __NR_mknodat 297 | ||
| 309 | #define __NR_fchownat 298 | ||
| 310 | #define __NR_futimesat 299 | ||
| 311 | #define __NR_fstatat64 300 | ||
| 312 | #define __NR_unlinkat 301 | ||
| 313 | #define __NR_renameat 302 | ||
| 314 | #define __NR_linkat 303 | ||
| 315 | #define __NR_symlinkat 304 | ||
| 316 | #define __NR_readlinkat 305 | ||
| 317 | #define __NR_fchmodat 306 | ||
| 318 | #define __NR_faccessat 307 | ||
| 319 | #define __NR_pselect6 308 | ||
| 320 | #define __NR_ppoll 309 | ||
| 321 | #define __NR_unshare 310 | ||
| 322 | #define __NR_set_robust_list 311 | ||
| 323 | #define __NR_get_robust_list 312 | ||
| 324 | #define __NR_splice 313 | ||
| 325 | #define __NR_sync_file_range 314 | ||
| 326 | #define __NR_tee 315 | ||
| 327 | #define __NR_vmsplice 316 | ||
| 328 | #define __NR_move_pages 317 | ||
| 329 | #define __NR_getcpu 318 | ||
| 330 | #define __NR_epoll_pwait 319 | ||
| 331 | #define __NR_utimensat 320 | ||
| 332 | #define __NR_signalfd 321 | ||
| 333 | #define __NR_timerfd_create 322 | ||
| 334 | #define __NR_eventfd 323 | ||
| 335 | #define __NR_fallocate 324 | ||
| 336 | #define __NR_timerfd_settime 325 | ||
| 337 | #define __NR_timerfd_gettime 326 | ||
| 338 | #define __NR_signalfd4 327 | ||
| 339 | #define __NR_eventfd2 328 | ||
| 340 | #define __NR_epoll_create1 329 | ||
| 341 | #define __NR_dup3 330 | ||
| 342 | #define __NR_pipe2 331 | ||
| 343 | #define __NR_inotify_init1 332 | ||
| 344 | #define __NR_preadv 333 | ||
| 345 | #define __NR_pwritev 334 | ||
| 346 | #define __NR_rt_tgsigqueueinfo 335 | ||
| 347 | #define __NR_perf_event_open 336 | ||
| 348 | #define __NR_fanotify_init 337 | ||
| 349 | #define __NR_fanotify_mark 338 | ||
| 350 | #define __NR_prlimit64 339 | ||
| 351 | |||
| 352 | /* Non-multiplexed socket family */ | ||
| 353 | #define __NR_socket 340 | ||
| 354 | #define __NR_bind 341 | ||
| 355 | #define __NR_connect 342 | ||
| 356 | #define __NR_listen 343 | ||
| 357 | #define __NR_accept 344 | ||
| 358 | #define __NR_getsockname 345 | ||
| 359 | #define __NR_getpeername 346 | ||
| 360 | #define __NR_socketpair 347 | ||
| 361 | #define __NR_send 348 | ||
| 362 | #define __NR_sendto 349 | ||
| 363 | #define __NR_recv 350 | ||
| 364 | #define __NR_recvfrom 351 | ||
| 365 | #define __NR_shutdown 352 | ||
| 366 | #define __NR_setsockopt 353 | ||
| 367 | #define __NR_getsockopt 354 | ||
| 368 | #define __NR_sendmsg 355 | ||
| 369 | #define __NR_recvmsg 356 | ||
| 370 | #define __NR_recvmmsg 357 | ||
| 371 | #define __NR_accept4 358 | ||
| 372 | #define __NR_name_to_handle_at 359 | ||
| 373 | #define __NR_open_by_handle_at 360 | ||
| 374 | #define __NR_clock_adjtime 361 | ||
| 375 | #define __NR_syncfs 362 | ||
| 376 | #define __NR_sendmmsg 363 | ||
| 377 | #define __NR_setns 364 | ||
| 378 | |||
| 379 | #define NR_syscalls 365 | ||
| 380 | |||
| 381 | #ifdef __KERNEL__ | ||
| 382 | |||
| 383 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
| 384 | #define __ARCH_WANT_OLD_READDIR | ||
| 385 | #define __ARCH_WANT_OLD_STAT | ||
| 386 | #define __ARCH_WANT_STAT64 | ||
| 387 | #define __ARCH_WANT_SYS_ALARM | ||
| 388 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
| 389 | #define __ARCH_WANT_SYS_IPC | ||
| 390 | #define __ARCH_WANT_SYS_PAUSE | ||
| 391 | #define __ARCH_WANT_SYS_SGETMASK | ||
| 392 | #define __ARCH_WANT_SYS_SIGNAL | ||
| 393 | #define __ARCH_WANT_SYS_TIME | ||
| 394 | #define __ARCH_WANT_SYS_UTIME | ||
| 395 | #define __ARCH_WANT_SYS_WAITPID | ||
| 396 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
| 397 | #define __ARCH_WANT_SYS_FADVISE64 | ||
| 398 | #define __ARCH_WANT_SYS_GETPGRP | ||
| 399 | #define __ARCH_WANT_SYS_LLSEEK | ||
| 400 | #define __ARCH_WANT_SYS_NICE | ||
| 401 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
| 402 | #define __ARCH_WANT_SYS_OLD_UNAME | ||
| 403 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
| 404 | #define __ARCH_WANT_SYS_SIGPENDING | ||
| 405 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
| 406 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
| 407 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
| 408 | |||
| 409 | /* | ||
| 410 | * "Conditional" syscalls | ||
| 411 | * | ||
| 412 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
| 413 | * but it doesn't work on all toolchains, so we just do it by hand | ||
| 414 | */ | ||
| 415 | #ifndef cond_syscall | ||
| 416 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
| 417 | #endif | ||
| 418 | |||
| 419 | #endif /* __KERNEL__ */ | ||
| 420 | #endif /* __ASM_SH_UNISTD_H */ | ||
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h new file mode 100644 index 00000000000..ec9898665f2 --- /dev/null +++ b/arch/sh/include/asm/unistd_64.h | |||
| @@ -0,0 +1,440 @@ | |||
| 1 | #ifndef __ASM_SH_UNISTD_64_H | ||
| 2 | #define __ASM_SH_UNISTD_64_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * include/asm-sh/unistd_64.h | ||
| 6 | * | ||
| 7 | * This file contains the system call numbers. | ||
| 8 | * | ||
| 9 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
| 10 | * Copyright (C) 2003 - 2007 Paul Mundt | ||
| 11 | * Copyright (C) 2004 Sean McGoogan | ||
| 12 | * | ||
| 13 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 14 | * License. See the file "COPYING" in the main directory of this archive | ||
| 15 | * for more details. | ||
| 16 | */ | ||
| 17 | #define __NR_restart_syscall 0 | ||
| 18 | #define __NR_exit 1 | ||
| 19 | #define __NR_fork 2 | ||
| 20 | #define __NR_read 3 | ||
| 21 | #define __NR_write 4 | ||
| 22 | #define __NR_open 5 | ||
| 23 | #define __NR_close 6 | ||
| 24 | #define __NR_waitpid 7 | ||
| 25 | #define __NR_creat 8 | ||
| 26 | #define __NR_link 9 | ||
| 27 | #define __NR_unlink 10 | ||
| 28 | #define __NR_execve 11 | ||
| 29 | #define __NR_chdir 12 | ||
| 30 | #define __NR_time 13 | ||
| 31 | #define __NR_mknod 14 | ||
| 32 | #define __NR_chmod 15 | ||
| 33 | #define __NR_lchown 16 | ||
| 34 | #define __NR_break 17 | ||
| 35 | #define __NR_oldstat 18 | ||
| 36 | #define __NR_lseek 19 | ||
| 37 | #define __NR_getpid 20 | ||
| 38 | #define __NR_mount 21 | ||
| 39 | #define __NR_umount 22 | ||
| 40 | #define __NR_setuid 23 | ||
| 41 | #define __NR_getuid 24 | ||
| 42 | #define __NR_stime 25 | ||
| 43 | #define __NR_ptrace 26 | ||
| 44 | #define __NR_alarm 27 | ||
| 45 | #define __NR_oldfstat 28 | ||
| 46 | #define __NR_pause 29 | ||
| 47 | #define __NR_utime 30 | ||
| 48 | #define __NR_stty 31 | ||
| 49 | #define __NR_gtty 32 | ||
| 50 | #define __NR_access 33 | ||
| 51 | #define __NR_nice 34 | ||
| 52 | #define __NR_ftime 35 | ||
| 53 | #define __NR_sync 36 | ||
| 54 | #define __NR_kill 37 | ||
| 55 | #define __NR_rename 38 | ||
| 56 | #define __NR_mkdir 39 | ||
| 57 | #define __NR_rmdir 40 | ||
| 58 | #define __NR_dup 41 | ||
| 59 | #define __NR_pipe 42 | ||
| 60 | #define __NR_times 43 | ||
| 61 | #define __NR_prof 44 | ||
| 62 | #define __NR_brk 45 | ||
| 63 | #define __NR_setgid 46 | ||
| 64 | #define __NR_getgid 47 | ||
| 65 | #define __NR_signal 48 | ||
| 66 | #define __NR_geteuid 49 | ||
| 67 | #define __NR_getegid 50 | ||
| 68 | #define __NR_acct 51 | ||
| 69 | #define __NR_umount2 52 | ||
| 70 | #define __NR_lock 53 | ||
| 71 | #define __NR_ioctl 54 | ||
| 72 | #define __NR_fcntl 55 | ||
| 73 | #define __NR_mpx 56 | ||
| 74 | #define __NR_setpgid 57 | ||
| 75 | #define __NR_ulimit 58 | ||
| 76 | #define __NR_oldolduname 59 | ||
| 77 | #define __NR_umask 60 | ||
| 78 | #define __NR_chroot 61 | ||
| 79 | #define __NR_ustat 62 | ||
| 80 | #define __NR_dup2 63 | ||
| 81 | #define __NR_getppid 64 | ||
| 82 | #define __NR_getpgrp 65 | ||
| 83 | #define __NR_setsid 66 | ||
| 84 | #define __NR_sigaction 67 | ||
| 85 | #define __NR_sgetmask 68 | ||
| 86 | #define __NR_ssetmask 69 | ||
| 87 | #define __NR_setreuid 70 | ||
| 88 | #define __NR_setregid 71 | ||
| 89 | #define __NR_sigsuspend 72 | ||
| 90 | #define __NR_sigpending 73 | ||
| 91 | #define __NR_sethostname 74 | ||
| 92 | #define __NR_setrlimit 75 | ||
| 93 | #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | ||
| 94 | #define __NR_getrusage 77 | ||
| 95 | #define __NR_gettimeofday 78 | ||
| 96 | #define __NR_settimeofday 79 | ||
| 97 | #define __NR_getgroups 80 | ||
| 98 | #define __NR_setgroups 81 | ||
| 99 | #define __NR_select 82 | ||
| 100 | #define __NR_symlink 83 | ||
| 101 | #define __NR_oldlstat 84 | ||
| 102 | #define __NR_readlink 85 | ||
| 103 | #define __NR_uselib 86 | ||
| 104 | #define __NR_swapon 87 | ||
| 105 | #define __NR_reboot 88 | ||
| 106 | #define __NR_readdir 89 | ||
| 107 | #define __NR_mmap 90 | ||
| 108 | #define __NR_munmap 91 | ||
| 109 | #define __NR_truncate 92 | ||
| 110 | #define __NR_ftruncate 93 | ||
| 111 | #define __NR_fchmod 94 | ||
| 112 | #define __NR_fchown 95 | ||
| 113 | #define __NR_getpriority 96 | ||
| 114 | #define __NR_setpriority 97 | ||
| 115 | #define __NR_profil 98 | ||
| 116 | #define __NR_statfs 99 | ||
| 117 | #define __NR_fstatfs 100 | ||
| 118 | #define __NR_ioperm 101 | ||
| 119 | #define __NR_socketcall 102 /* old implementation of socket systemcall */ | ||
| 120 | #define __NR_syslog 103 | ||
| 121 | #define __NR_setitimer 104 | ||
| 122 | #define __NR_getitimer 105 | ||
| 123 | #define __NR_stat 106 | ||
| 124 | #define __NR_lstat 107 | ||
| 125 | #define __NR_fstat 108 | ||
| 126 | #define __NR_olduname 109 | ||
| 127 | #define __NR_iopl 110 | ||
| 128 | #define __NR_vhangup 111 | ||
| 129 | #define __NR_idle 112 | ||
| 130 | #define __NR_vm86old 113 | ||
| 131 | #define __NR_wait4 114 | ||
| 132 | #define __NR_swapoff 115 | ||
| 133 | #define __NR_sysinfo 116 | ||
| 134 | #define __NR_ipc 117 | ||
| 135 | #define __NR_fsync 118 | ||
| 136 | #define __NR_sigreturn 119 | ||
| 137 | #define __NR_clone 120 | ||
| 138 | #define __NR_setdomainname 121 | ||
| 139 | #define __NR_uname 122 | ||
| 140 | #define __NR_cacheflush 123 | ||
| 141 | #define __NR_adjtimex 124 | ||
| 142 | #define __NR_mprotect 125 | ||
| 143 | #define __NR_sigprocmask 126 | ||
| 144 | #define __NR_create_module 127 | ||
| 145 | #define __NR_init_module 128 | ||
| 146 | #define __NR_delete_module 129 | ||
| 147 | #define __NR_get_kernel_syms 130 | ||
| 148 | #define __NR_quotactl 131 | ||
| 149 | #define __NR_getpgid 132 | ||
| 150 | #define __NR_fchdir 133 | ||
| 151 | #define __NR_bdflush 134 | ||
| 152 | #define __NR_sysfs 135 | ||
| 153 | #define __NR_personality 136 | ||
| 154 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
| 155 | #define __NR_setfsuid 138 | ||
| 156 | #define __NR_setfsgid 139 | ||
| 157 | #define __NR__llseek 140 | ||
| 158 | #define __NR_getdents 141 | ||
| 159 | #define __NR__newselect 142 | ||
| 160 | #define __NR_flock 143 | ||
| 161 | #define __NR_msync 144 | ||
| 162 | #define __NR_readv 145 | ||
| 163 | #define __NR_writev 146 | ||
| 164 | #define __NR_getsid 147 | ||
| 165 | #define __NR_fdatasync 148 | ||
| 166 | #define __NR__sysctl 149 | ||
| 167 | #define __NR_mlock 150 | ||
| 168 | #define __NR_munlock 151 | ||
| 169 | #define __NR_mlockall 152 | ||
| 170 | #define __NR_munlockall 153 | ||
| 171 | #define __NR_sched_setparam 154 | ||
| 172 | #define __NR_sched_getparam 155 | ||
| 173 | #define __NR_sched_setscheduler 156 | ||
| 174 | #define __NR_sched_getscheduler 157 | ||
| 175 | #define __NR_sched_yield 158 | ||
| 176 | #define __NR_sched_get_priority_max 159 | ||
| 177 | #define __NR_sched_get_priority_min 160 | ||
| 178 | #define __NR_sched_rr_get_interval 161 | ||
| 179 | #define __NR_nanosleep 162 | ||
| 180 | #define __NR_mremap 163 | ||
| 181 | #define __NR_setresuid 164 | ||
| 182 | #define __NR_getresuid 165 | ||
| 183 | #define __NR_vm86 166 | ||
| 184 | #define __NR_query_module 167 | ||
| 185 | #define __NR_poll 168 | ||
| 186 | #define __NR_nfsservctl 169 | ||
| 187 | #define __NR_setresgid 170 | ||
| 188 | #define __NR_getresgid 171 | ||
| 189 | #define __NR_prctl 172 | ||
| 190 | #define __NR_rt_sigreturn 173 | ||
| 191 | #define __NR_rt_sigaction 174 | ||
| 192 | #define __NR_rt_sigprocmask 175 | ||
| 193 | #define __NR_rt_sigpending 176 | ||
| 194 | #define __NR_rt_sigtimedwait 177 | ||
| 195 | #define __NR_rt_sigqueueinfo 178 | ||
| 196 | #define __NR_rt_sigsuspend 179 | ||
| 197 | #define __NR_pread64 180 | ||
| 198 | #define __NR_pwrite64 181 | ||
| 199 | #define __NR_chown 182 | ||
| 200 | #define __NR_getcwd 183 | ||
| 201 | #define __NR_capget 184 | ||
| 202 | #define __NR_capset 185 | ||
| 203 | #define __NR_sigaltstack 186 | ||
| 204 | #define __NR_sendfile 187 | ||
| 205 | #define __NR_streams1 188 /* some people actually want it */ | ||
| 206 | #define __NR_streams2 189 /* some people actually want it */ | ||
| 207 | #define __NR_vfork 190 | ||
| 208 | #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ | ||
| 209 | #define __NR_mmap2 192 | ||
| 210 | #define __NR_truncate64 193 | ||
| 211 | #define __NR_ftruncate64 194 | ||
| 212 | #define __NR_stat64 195 | ||
| 213 | #define __NR_lstat64 196 | ||
| 214 | #define __NR_fstat64 197 | ||
| 215 | #define __NR_lchown32 198 | ||
| 216 | #define __NR_getuid32 199 | ||
| 217 | #define __NR_getgid32 200 | ||
| 218 | #define __NR_geteuid32 201 | ||
| 219 | #define __NR_getegid32 202 | ||
| 220 | #define __NR_setreuid32 203 | ||
| 221 | #define __NR_setregid32 204 | ||
| 222 | #define __NR_getgroups32 205 | ||
| 223 | #define __NR_setgroups32 206 | ||
| 224 | #define __NR_fchown32 207 | ||
| 225 | #define __NR_setresuid32 208 | ||
| 226 | #define __NR_getresuid32 209 | ||
| 227 | #define __NR_setresgid32 210 | ||
| 228 | #define __NR_getresgid32 211 | ||
| 229 | #define __NR_chown32 212 | ||
| 230 | #define __NR_setuid32 213 | ||
| 231 | #define __NR_setgid32 214 | ||
| 232 | #define __NR_setfsuid32 215 | ||
| 233 | #define __NR_setfsgid32 216 | ||
| 234 | #define __NR_pivot_root 217 | ||
| 235 | #define __NR_mincore 218 | ||
| 236 | #define __NR_madvise 219 | ||
| 237 | |||
| 238 | /* Non-multiplexed socket family */ | ||
| 239 | #define __NR_socket 220 | ||
| 240 | #define __NR_bind 221 | ||
| 241 | #define __NR_connect 222 | ||
| 242 | #define __NR_listen 223 | ||
| 243 | #define __NR_accept 224 | ||
| 244 | #define __NR_getsockname 225 | ||
| 245 | #define __NR_getpeername 226 | ||
| 246 | #define __NR_socketpair 227 | ||
| 247 | #define __NR_send 228 | ||
| 248 | #define __NR_sendto 229 | ||
| 249 | #define __NR_recv 230 | ||
| 250 | #define __NR_recvfrom 231 | ||
| 251 | #define __NR_shutdown 232 | ||
| 252 | #define __NR_setsockopt 233 | ||
| 253 | #define __NR_getsockopt 234 | ||
| 254 | #define __NR_sendmsg 235 | ||
| 255 | #define __NR_recvmsg 236 | ||
| 256 | |||
| 257 | /* Non-multiplexed IPC family */ | ||
| 258 | #define __NR_semop 237 | ||
| 259 | #define __NR_semget 238 | ||
| 260 | #define __NR_semctl 239 | ||
| 261 | #define __NR_msgsnd 240 | ||
| 262 | #define __NR_msgrcv 241 | ||
| 263 | #define __NR_msgget 242 | ||
| 264 | #define __NR_msgctl 243 | ||
| 265 | #if 0 | ||
| 266 | #define __NR_shmatcall 244 | ||
| 267 | #endif | ||
| 268 | #define __NR_shmdt 245 | ||
| 269 | #define __NR_shmget 246 | ||
| 270 | #define __NR_shmctl 247 | ||
| 271 | |||
| 272 | #define __NR_getdents64 248 | ||
| 273 | #define __NR_fcntl64 249 | ||
| 274 | /* 223 is unused */ | ||
| 275 | #define __NR_gettid 252 | ||
| 276 | #define __NR_readahead 253 | ||
| 277 | #define __NR_setxattr 254 | ||
| 278 | #define __NR_lsetxattr 255 | ||
| 279 | #define __NR_fsetxattr 256 | ||
| 280 | #define __NR_getxattr 257 | ||
| 281 | #define __NR_lgetxattr 258 | ||
| 282 | #define __NR_fgetxattr 269 | ||
| 283 | #define __NR_listxattr 260 | ||
| 284 | #define __NR_llistxattr 261 | ||
| 285 | #define __NR_flistxattr 262 | ||
| 286 | #define __NR_removexattr 263 | ||
| 287 | #define __NR_lremovexattr 264 | ||
| 288 | #define __NR_fremovexattr 265 | ||
| 289 | #define __NR_tkill 266 | ||
| 290 | #define __NR_sendfile64 267 | ||
| 291 | #define __NR_futex 268 | ||
| 292 | #define __NR_sched_setaffinity 269 | ||
| 293 | #define __NR_sched_getaffinity 270 | ||
| 294 | #define __NR_set_thread_area 271 | ||
| 295 | #define __NR_get_thread_area 272 | ||
| 296 | #define __NR_io_setup 273 | ||
| 297 | #define __NR_io_destroy 274 | ||
| 298 | #define __NR_io_getevents 275 | ||
| 299 | #define __NR_io_submit 276 | ||
| 300 | #define __NR_io_cancel 277 | ||
| 301 | #define __NR_fadvise64 278 | ||
| 302 | #define __NR_exit_group 280 | ||
| 303 | |||
| 304 | #define __NR_lookup_dcookie 281 | ||
| 305 | #define __NR_epoll_create 282 | ||
| 306 | #define __NR_epoll_ctl 283 | ||
| 307 | #define __NR_epoll_wait 284 | ||
| 308 | #define __NR_remap_file_pages 285 | ||
| 309 | #define __NR_set_tid_address 286 | ||
| 310 | #define __NR_timer_create 287 | ||
| 311 | #define __NR_timer_settime (__NR_timer_create+1) | ||
| 312 | #define __NR_timer_gettime (__NR_timer_create+2) | ||
| 313 | #define __NR_timer_getoverrun (__NR_timer_create+3) | ||
| 314 | #define __NR_timer_delete (__NR_timer_create+4) | ||
| 315 | #define __NR_clock_settime (__NR_timer_create+5) | ||
| 316 | #define __NR_clock_gettime (__NR_timer_create+6) | ||
| 317 | #define __NR_clock_getres (__NR_timer_create+7) | ||
| 318 | #define __NR_clock_nanosleep (__NR_timer_create+8) | ||
| 319 | #define __NR_statfs64 296 | ||
| 320 | #define __NR_fstatfs64 297 | ||
| 321 | #define __NR_tgkill 298 | ||
| 322 | #define __NR_utimes 299 | ||
| 323 | #define __NR_fadvise64_64 300 | ||
| 324 | #define __NR_vserver 301 | ||
| 325 | #define __NR_mbind 302 | ||
| 326 | #define __NR_get_mempolicy 303 | ||
| 327 | #define __NR_set_mempolicy 304 | ||
| 328 | #define __NR_mq_open 305 | ||
| 329 | #define __NR_mq_unlink (__NR_mq_open+1) | ||
| 330 | #define __NR_mq_timedsend (__NR_mq_open+2) | ||
| 331 | #define __NR_mq_timedreceive (__NR_mq_open+3) | ||
| 332 | #define __NR_mq_notify (__NR_mq_open+4) | ||
| 333 | #define __NR_mq_getsetattr (__NR_mq_open+5) | ||
| 334 | #define __NR_kexec_load 311 | ||
| 335 | #define __NR_waitid 312 | ||
| 336 | #define __NR_add_key 313 | ||
| 337 | #define __NR_request_key 314 | ||
| 338 | #define __NR_keyctl 315 | ||
| 339 | #define __NR_ioprio_set 316 | ||
| 340 | #define __NR_ioprio_get 317 | ||
| 341 | #define __NR_inotify_init 318 | ||
| 342 | #define __NR_inotify_add_watch 319 | ||
| 343 | #define __NR_inotify_rm_watch 320 | ||
| 344 | /* 321 is unused */ | ||
| 345 | #define __NR_migrate_pages 322 | ||
| 346 | #define __NR_openat 323 | ||
| 347 | #define __NR_mkdirat 324 | ||
| 348 | #define __NR_mknodat 325 | ||
| 349 | #define __NR_fchownat 326 | ||
| 350 | #define __NR_futimesat 327 | ||
| 351 | #define __NR_fstatat64 328 | ||
| 352 | #define __NR_unlinkat 329 | ||
| 353 | #define __NR_renameat 330 | ||
| 354 | #define __NR_linkat 331 | ||
| 355 | #define __NR_symlinkat 332 | ||
| 356 | #define __NR_readlinkat 333 | ||
| 357 | #define __NR_fchmodat 334 | ||
| 358 | #define __NR_faccessat 335 | ||
| 359 | #define __NR_pselect6 336 | ||
| 360 | #define __NR_ppoll 337 | ||
| 361 | #define __NR_unshare 338 | ||
| 362 | #define __NR_set_robust_list 339 | ||
| 363 | #define __NR_get_robust_list 340 | ||
| 364 | #define __NR_splice 341 | ||
| 365 | #define __NR_sync_file_range 342 | ||
| 366 | #define __NR_tee 343 | ||
| 367 | #define __NR_vmsplice 344 | ||
| 368 | #define __NR_move_pages 345 | ||
| 369 | #define __NR_getcpu 346 | ||
| 370 | #define __NR_epoll_pwait 347 | ||
| 371 | #define __NR_utimensat 348 | ||
| 372 | #define __NR_signalfd 349 | ||
| 373 | #define __NR_timerfd_create 350 | ||
| 374 | #define __NR_eventfd 351 | ||
| 375 | #define __NR_fallocate 352 | ||
| 376 | #define __NR_timerfd_settime 353 | ||
| 377 | #define __NR_timerfd_gettime 354 | ||
| 378 | #define __NR_signalfd4 355 | ||
| 379 | #define __NR_eventfd2 356 | ||
| 380 | #define __NR_epoll_create1 357 | ||
| 381 | #define __NR_dup3 358 | ||
| 382 | #define __NR_pipe2 359 | ||
| 383 | #define __NR_inotify_init1 360 | ||
| 384 | #define __NR_preadv 361 | ||
| 385 | #define __NR_pwritev 362 | ||
| 386 | #define __NR_rt_tgsigqueueinfo 363 | ||
| 387 | #define __NR_perf_event_open 364 | ||
| 388 | #define __NR_recvmmsg 365 | ||
| 389 | #define __NR_accept4 366 | ||
| 390 | #define __NR_fanotify_init 367 | ||
| 391 | #define __NR_fanotify_mark 368 | ||
| 392 | #define __NR_prlimit64 369 | ||
| 393 | #define __NR_name_to_handle_at 370 | ||
| 394 | #define __NR_open_by_handle_at 371 | ||
| 395 | #define __NR_clock_adjtime 372 | ||
| 396 | #define __NR_syncfs 373 | ||
| 397 | #define __NR_sendmmsg 374 | ||
| 398 | #define __NR_setns 375 | ||
| 399 | |||
| 400 | #ifdef __KERNEL__ | ||
| 401 | |||
| 402 | #define NR_syscalls 376 | ||
| 403 | |||
| 404 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
| 405 | #define __ARCH_WANT_OLD_READDIR | ||
| 406 | #define __ARCH_WANT_OLD_STAT | ||
| 407 | #define __ARCH_WANT_STAT64 | ||
| 408 | #define __ARCH_WANT_SYS_ALARM | ||
| 409 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
| 410 | #define __ARCH_WANT_SYS_IPC | ||
| 411 | #define __ARCH_WANT_SYS_PAUSE | ||
| 412 | #define __ARCH_WANT_SYS_SGETMASK | ||
| 413 | #define __ARCH_WANT_SYS_SIGNAL | ||
| 414 | #define __ARCH_WANT_SYS_TIME | ||
| 415 | #define __ARCH_WANT_SYS_UTIME | ||
| 416 | #define __ARCH_WANT_SYS_WAITPID | ||
| 417 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
| 418 | #define __ARCH_WANT_SYS_FADVISE64 | ||
| 419 | #define __ARCH_WANT_SYS_GETPGRP | ||
| 420 | #define __ARCH_WANT_SYS_LLSEEK | ||
| 421 | #define __ARCH_WANT_SYS_NICE | ||
| 422 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
| 423 | #define __ARCH_WANT_SYS_OLD_UNAME | ||
| 424 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
| 425 | #define __ARCH_WANT_SYS_SIGPENDING | ||
| 426 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
| 427 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
| 428 | |||
| 429 | /* | ||
| 430 | * "Conditional" syscalls | ||
| 431 | * | ||
| 432 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
| 433 | * but it doesn't work on all toolchains, so we just do it by hand | ||
| 434 | */ | ||
| 435 | #ifndef cond_syscall | ||
| 436 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
| 437 | #endif | ||
| 438 | |||
| 439 | #endif /* __KERNEL__ */ | ||
| 440 | #endif /* __ASM_SH_UNISTD_64_H */ | ||
diff --git a/arch/sh/include/asm/xor.h b/arch/sh/include/asm/xor.h new file mode 100644 index 00000000000..c82eb12a5b1 --- /dev/null +++ b/arch/sh/include/asm/xor.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/xor.h> | |||
diff --git a/arch/sh/include/cpu-sh2/cpu/dma.h b/arch/sh/include/cpu-sh2/cpu/dma.h new file mode 100644 index 00000000000..d66b43cdc63 --- /dev/null +++ b/arch/sh/include/cpu-sh2/cpu/dma.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for the SH-2 DMAC. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Paul Mundt | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | #ifndef __ASM_CPU_SH2_DMA_H | ||
| 11 | #define __ASM_CPU_SH2_DMA_H | ||
| 12 | |||
| 13 | #define SH_MAX_DMA_CHANNELS 2 | ||
| 14 | |||
| 15 | #define SAR ((unsigned long[]){ 0xffffff80, 0xffffff90 }) | ||
| 16 | #define DAR ((unsigned long[]){ 0xffffff84, 0xffffff94 }) | ||
| 17 | #define DMATCR ((unsigned long[]){ 0xffffff88, 0xffffff98 }) | ||
| 18 | #define CHCR ((unsigned long[]){ 0xfffffffc, 0xffffff9c }) | ||
| 19 | |||
| 20 | #define DMAOR 0xffffffb0 | ||
| 21 | |||
| 22 | #endif /* __ASM_CPU_SH2_DMA_H */ | ||
| 23 | |||
diff --git a/arch/sh/include/cpu-sh2a/cpu/dma.h b/arch/sh/include/cpu-sh2a/cpu/dma.h new file mode 100644 index 00000000000..27a13ef4fdf --- /dev/null +++ b/arch/sh/include/cpu-sh2a/cpu/dma.h | |||
| @@ -0,0 +1 @@ | |||
| #include <cpu-sh2/cpu/dma.h> | |||
diff --git a/arch/sh/include/cpu-sh2a/cpu/ubc.h b/arch/sh/include/cpu-sh2a/cpu/ubc.h new file mode 100644 index 00000000000..1192e1c761a --- /dev/null +++ b/arch/sh/include/cpu-sh2a/cpu/ubc.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * SH-2A UBC definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Kieran Bingham | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ASM_CPU_SH2A_UBC_H | ||
| 12 | #define __ASM_CPU_SH2A_UBC_H | ||
| 13 | |||
| 14 | #define UBC_BARA 0xfffc0400 | ||
| 15 | #define UBC_BAMRA 0xfffc0404 | ||
| 16 | #define UBC_BBRA 0xfffc04a0 /* 16 bit access */ | ||
| 17 | #define UBC_BDRA 0xfffc0408 | ||
| 18 | #define UBC_BDMRA 0xfffc040c | ||
| 19 | |||
| 20 | #define UBC_BARB 0xfffc0410 | ||
| 21 | #define UBC_BAMRB 0xfffc0414 | ||
| 22 | #define UBC_BBRB 0xfffc04b0 /* 16 bit access */ | ||
| 23 | #define UBC_BDRB 0xfffc0418 | ||
| 24 | #define UBC_BDMRB 0xfffc041c | ||
| 25 | |||
| 26 | #define UBC_BRCR 0xfffc04c0 | ||
| 27 | |||
| 28 | #endif /* __ASM_CPU_SH2A_UBC_H */ | ||
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h new file mode 100644 index 00000000000..9647e681fd2 --- /dev/null +++ b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | #ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H | ||
| 2 | #define __ASM_SH_CPU_SH4_DMA_SH7780_H | ||
| 3 | |||
| 4 | #if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ | ||
| 5 | defined(CONFIG_CPU_SUBTYPE_SH7730) | ||
| 6 | #define DMTE0_IRQ 48 | ||
| 7 | #define DMTE4_IRQ 76 | ||
| 8 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | ||
| 9 | #define SH_DMAC_BASE0 0xFE008020 | ||
| 10 | #define SH_DMARS_BASE0 0xFE009000 | ||
| 11 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | ||
| 12 | #define DMTE0_IRQ 48 | ||
| 13 | #define DMTE4_IRQ 76 | ||
| 14 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | ||
| 15 | #define SH_DMAC_BASE0 0xFE008020 | ||
| 16 | #define SH_DMARS_BASE0 0xFE009000 | ||
| 17 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | ||
| 18 | defined(CONFIG_CPU_SUBTYPE_SH7764) | ||
| 19 | #define DMTE0_IRQ 34 | ||
| 20 | #define DMTE4_IRQ 44 | ||
| 21 | #define DMAE0_IRQ 38 | ||
| 22 | #define SH_DMAC_BASE0 0xFF608020 | ||
| 23 | #define SH_DMARS_BASE0 0xFF609000 | ||
| 24 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) | ||
| 25 | #define DMTE0_IRQ 48 /* DMAC0A*/ | ||
| 26 | #define DMTE4_IRQ 76 /* DMAC0B */ | ||
| 27 | #define DMTE6_IRQ 40 | ||
| 28 | #define DMTE8_IRQ 42 /* DMAC1A */ | ||
| 29 | #define DMTE9_IRQ 43 | ||
| 30 | #define DMTE10_IRQ 72 /* DMAC1B */ | ||
| 31 | #define DMTE11_IRQ 73 | ||
| 32 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | ||
| 33 | #define DMAE1_IRQ 74 /* DMA Error IRQ*/ | ||
| 34 | #define SH_DMAC_BASE0 0xFE008020 | ||
| 35 | #define SH_DMAC_BASE1 0xFDC08020 | ||
| 36 | #define SH_DMARS_BASE0 0xFDC09000 | ||
| 37 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) | ||
| 38 | #define DMTE0_IRQ 48 /* DMAC0A*/ | ||
| 39 | #define DMTE4_IRQ 76 /* DMAC0B */ | ||
| 40 | #define DMTE6_IRQ 40 | ||
| 41 | #define DMTE8_IRQ 42 /* DMAC1A */ | ||
| 42 | #define DMTE9_IRQ 43 | ||
| 43 | #define DMTE10_IRQ 72 /* DMAC1B */ | ||
| 44 | #define DMTE11_IRQ 73 | ||
| 45 | #define DMAE0_IRQ 78 /* DMA Error IRQ*/ | ||
| 46 | #define DMAE1_IRQ 74 /* DMA Error IRQ*/ | ||
| 47 | #define SH_DMAC_BASE0 0xFE008020 | ||
| 48 | #define SH_DMAC_BASE1 0xFDC08020 | ||
| 49 | #define SH_DMARS_BASE0 0xFE009000 | ||
| 50 | #define SH_DMARS_BASE1 0xFDC09000 | ||
| 51 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | ||
| 52 | #define DMTE0_IRQ 34 | ||
| 53 | #define DMTE4_IRQ 44 | ||
| 54 | #define DMTE6_IRQ 46 | ||
| 55 | #define DMTE8_IRQ 92 | ||
| 56 | #define DMTE9_IRQ 93 | ||
| 57 | #define DMTE10_IRQ 94 | ||
| 58 | #define DMTE11_IRQ 95 | ||
| 59 | #define DMAE0_IRQ 38 /* DMA Error IRQ */ | ||
| 60 | #define SH_DMAC_BASE0 0xFC808020 | ||
| 61 | #define SH_DMAC_BASE1 0xFC818020 | ||
| 62 | #define SH_DMARS_BASE0 0xFC809000 | ||
| 63 | #else /* SH7785 */ | ||
| 64 | #define DMTE0_IRQ 33 | ||
| 65 | #define DMTE4_IRQ 37 | ||
| 66 | #define DMTE6_IRQ 52 | ||
| 67 | #define DMTE8_IRQ 54 | ||
| 68 | #define DMTE9_IRQ 55 | ||
| 69 | #define DMTE10_IRQ 56 | ||
| 70 | #define DMTE11_IRQ 57 | ||
| 71 | #define DMAE0_IRQ 39 /* DMA Error IRQ0 */ | ||
| 72 | #define DMAE1_IRQ 58 /* DMA Error IRQ1 */ | ||
| 73 | #define SH_DMAC_BASE0 0xFC808020 | ||
| 74 | #define SH_DMAC_BASE1 0xFCC08020 | ||
| 75 | #define SH_DMARS_BASE0 0xFC809000 | ||
| 76 | #endif | ||
| 77 | |||
| 78 | #define REQ_HE 0x000000C0 | ||
| 79 | #define REQ_H 0x00000080 | ||
| 80 | #define REQ_LE 0x00000040 | ||
| 81 | #define TM_BURST 0x00000020 | ||
| 82 | |||
| 83 | #endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */ | ||
diff --git a/arch/sh/include/cpu-sh5/cpu/dma.h b/arch/sh/include/cpu-sh5/cpu/dma.h new file mode 100644 index 00000000000..7bf6bb3d35e --- /dev/null +++ b/arch/sh/include/cpu-sh5/cpu/dma.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_CPU_SH5_DMA_H | ||
| 2 | #define __ASM_SH_CPU_SH5_DMA_H | ||
| 3 | |||
| 4 | /* Nothing yet */ | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_CPU_SH5_DMA_H */ | ||
