diff options
Diffstat (limited to 'include/asm-m68knommu')
-rw-r--r-- | include/asm-m68knommu/checksum.h | 46 | ||||
-rw-r--r-- | include/asm-m68knommu/device.h | 7 | ||||
-rw-r--r-- | include/asm-m68knommu/dma-mapping.h | 3 | ||||
-rw-r--r-- | include/asm-m68knommu/irq.h | 1 | ||||
-rw-r--r-- | include/asm-m68knommu/irq_regs.h | 1 | ||||
-rw-r--r-- | include/asm-m68knommu/irqnode.h | 8 | ||||
-rw-r--r-- | include/asm-m68knommu/m520xsim.h | 12 | ||||
-rw-r--r-- | include/asm-m68knommu/machdep.h | 2 | ||||
-rw-r--r-- | include/asm-m68knommu/mcfmbus.h | 2 | ||||
-rw-r--r-- | include/asm-m68knommu/rtc.h | 1 | ||||
-rw-r--r-- | include/asm-m68knommu/scatterlist.h | 2 | ||||
-rw-r--r-- | include/asm-m68knommu/setup.h | 5 | ||||
-rw-r--r-- | include/asm-m68knommu/ucontext.h | 6 | ||||
-rw-r--r-- | include/asm-m68knommu/unistd.h | 150 |
14 files changed, 57 insertions, 189 deletions
diff --git a/include/asm-m68knommu/checksum.h b/include/asm-m68knommu/checksum.h index 294ec7583ac9..81883482ffb1 100644 --- a/include/asm-m68knommu/checksum.h +++ b/include/asm-m68knommu/checksum.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * it's best to have buff aligned on a 32-bit boundary | 16 | * it's best to have buff aligned on a 32-bit boundary |
17 | */ | 17 | */ |
18 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 18 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * the same as csum_partial, but copies from src while it | 21 | * the same as csum_partial, but copies from src while it |
@@ -25,8 +25,8 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
25 | * better 64-bit) boundary | 25 | * better 64-bit) boundary |
26 | */ | 26 | */ |
27 | 27 | ||
28 | unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | 28 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
29 | int len, int sum); | 29 | int len, __wsum sum); |
30 | 30 | ||
31 | 31 | ||
32 | /* | 32 | /* |
@@ -36,33 +36,31 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | |||
36 | * better 64-bit) boundary | 36 | * better 64-bit) boundary |
37 | */ | 37 | */ |
38 | 38 | ||
39 | extern unsigned int csum_partial_copy_from_user(const unsigned char *src, | 39 | extern __wsum csum_partial_copy_from_user(const void __user *src, |
40 | unsigned char *dst, int len, int sum, int *csum_err); | 40 | void *dst, int len, __wsum sum, int *csum_err); |
41 | 41 | ||
42 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 42 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
43 | csum_partial_copy((src), (dst), (len), (sum)) | ||
44 | |||
45 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl); | ||
46 | 43 | ||
47 | /* | 44 | /* |
48 | * Fold a partial checksum | 45 | * Fold a partial checksum |
49 | */ | 46 | */ |
50 | 47 | ||
51 | static inline unsigned int csum_fold(unsigned int sum) | 48 | static inline __sum16 csum_fold(__wsum sum) |
52 | { | 49 | { |
50 | unsigned int tmp = (__force u32)sum; | ||
53 | #ifdef CONFIG_COLDFIRE | 51 | #ifdef CONFIG_COLDFIRE |
54 | sum = (sum & 0xffff) + (sum >> 16); | 52 | tmp = (tmp & 0xffff) + (tmp >> 16); |
55 | sum = (sum & 0xffff) + (sum >> 16); | 53 | tmp = (tmp & 0xffff) + (tmp >> 16); |
54 | return (__force __sum16)~tmp; | ||
56 | #else | 55 | #else |
57 | unsigned int tmp = sum; | ||
58 | __asm__("swap %1\n\t" | 56 | __asm__("swap %1\n\t" |
59 | "addw %1, %0\n\t" | 57 | "addw %1, %0\n\t" |
60 | "clrw %1\n\t" | 58 | "clrw %1\n\t" |
61 | "addxw %1, %0" | 59 | "addxw %1, %0" |
62 | : "=&d" (sum), "=&d" (tmp) | 60 | : "=&d" (sum), "=&d" (tmp) |
63 | : "0" (sum), "1" (sum)); | 61 | : "0" (sum), "1" (sum)); |
62 | return (__force __sum16)~sum; | ||
64 | #endif | 63 | #endif |
65 | return ~sum; | ||
66 | } | 64 | } |
67 | 65 | ||
68 | 66 | ||
@@ -71,9 +69,9 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
71 | * returns a 16-bit checksum, already complemented | 69 | * returns a 16-bit checksum, already complemented |
72 | */ | 70 | */ |
73 | 71 | ||
74 | static inline unsigned int | 72 | static inline __wsum |
75 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 73 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
76 | unsigned short proto, unsigned int sum) | 74 | unsigned short proto, __wsum sum) |
77 | { | 75 | { |
78 | __asm__ ("addl %1,%0\n\t" | 76 | __asm__ ("addl %1,%0\n\t" |
79 | "addxl %4,%0\n\t" | 77 | "addxl %4,%0\n\t" |
@@ -86,9 +84,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
86 | return sum; | 84 | return sum; |
87 | } | 85 | } |
88 | 86 | ||
89 | static inline unsigned short int | 87 | static inline __sum16 |
90 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 88 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
91 | unsigned short proto, unsigned int sum) | 89 | unsigned short proto, __wsum sum) |
92 | { | 90 | { |
93 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 91 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
94 | } | 92 | } |
@@ -98,12 +96,12 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
98 | * in icmp.c | 96 | * in icmp.c |
99 | */ | 97 | */ |
100 | 98 | ||
101 | extern unsigned short ip_compute_csum(const unsigned char * buff, int len); | 99 | extern __sum16 ip_compute_csum(const void *buff, int len); |
102 | 100 | ||
103 | #define _HAVE_ARCH_IPV6_CSUM | 101 | #define _HAVE_ARCH_IPV6_CSUM |
104 | static __inline__ unsigned short int | 102 | static __inline__ __sum16 |
105 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | 103 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, |
106 | __u32 len, unsigned short proto, unsigned int sum) | 104 | __u32 len, unsigned short proto, __wsum sum) |
107 | { | 105 | { |
108 | register unsigned long tmp; | 106 | register unsigned long tmp; |
109 | __asm__("addl %2@,%0\n\t" | 107 | __asm__("addl %2@,%0\n\t" |
diff --git a/include/asm-m68knommu/device.h b/include/asm-m68knommu/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m68knommu/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68knommu/dma-mapping.h b/include/asm-m68knommu/dma-mapping.h index 5622b855a577..6aeab18e58bd 100644 --- a/include/asm-m68knommu/dma-mapping.h +++ b/include/asm-m68knommu/dma-mapping.h | |||
@@ -1,9 +1,10 @@ | |||
1 | #ifndef _M68KNOMMU_DMA_MAPPING_H | 1 | #ifndef _M68KNOMMU_DMA_MAPPING_H |
2 | #define _M68KNOMMU_DMA_MAPPING_H | 2 | #define _M68KNOMMU_DMA_MAPPING_H |
3 | 3 | ||
4 | |||
5 | #ifdef CONFIG_PCI | 4 | #ifdef CONFIG_PCI |
6 | #include <asm-generic/dma-mapping.h> | 5 | #include <asm-generic/dma-mapping.h> |
6 | #else | ||
7 | #include <asm-generic/dma-mapping-broken.h> | ||
7 | #endif | 8 | #endif |
8 | 9 | ||
9 | #endif /* _M68KNOMMU_DMA_MAPPING_H */ | 10 | #endif /* _M68KNOMMU_DMA_MAPPING_H */ |
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h index 45e7a2fd1689..7b8f874f8429 100644 --- a/include/asm-m68knommu/irq.h +++ b/include/asm-m68knommu/irq.h | |||
@@ -86,5 +86,6 @@ extern void (*mach_disable_irq)(unsigned int); | |||
86 | #define enable_irq(x) do { } while (0) | 86 | #define enable_irq(x) do { } while (0) |
87 | #define disable_irq(x) do { } while (0) | 87 | #define disable_irq(x) do { } while (0) |
88 | #define disable_irq_nosync(x) disable_irq(x) | 88 | #define disable_irq_nosync(x) disable_irq(x) |
89 | #define irq_canonicalize(irq) (irq) | ||
89 | 90 | ||
90 | #endif /* _M68K_IRQ_H_ */ | 91 | #endif /* _M68K_IRQ_H_ */ |
diff --git a/include/asm-m68knommu/irq_regs.h b/include/asm-m68knommu/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-m68knommu/irq_regs.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/irq_regs.h> | |||
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h index a2503dfc554c..6132a9858b52 100644 --- a/include/asm-m68knommu/irqnode.h +++ b/include/asm-m68knommu/irqnode.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * interrupt source (if it supports chaining). | 8 | * interrupt source (if it supports chaining). |
9 | */ | 9 | */ |
10 | typedef struct irq_node { | 10 | typedef struct irq_node { |
11 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 11 | irq_handler_t handler; |
12 | unsigned long flags; | 12 | unsigned long flags; |
13 | void *dev_id; | 13 | void *dev_id; |
14 | const char *devname; | 14 | const char *devname; |
@@ -18,12 +18,12 @@ typedef struct irq_node { | |||
18 | /* | 18 | /* |
19 | * This structure has only 4 elements for speed reasons | 19 | * This structure has only 4 elements for speed reasons |
20 | */ | 20 | */ |
21 | typedef struct irq_handler { | 21 | struct irq_entry { |
22 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 22 | irq_handler_t handler; |
23 | unsigned long flags; | 23 | unsigned long flags; |
24 | void *dev_id; | 24 | void *dev_id; |
25 | const char *devname; | 25 | const char *devname; |
26 | } irq_handler_t; | 26 | }; |
27 | 27 | ||
28 | /* count of spurious interrupts */ | 28 | /* count of spurious interrupts */ |
29 | extern volatile unsigned int num_spurious; | 29 | extern volatile unsigned int num_spurious; |
diff --git a/include/asm-m68knommu/m520xsim.h b/include/asm-m68knommu/m520xsim.h index 1dac22ea95ba..49d016e6391a 100644 --- a/include/asm-m68knommu/m520xsim.h +++ b/include/asm-m68knommu/m520xsim.h | |||
@@ -31,6 +31,16 @@ | |||
31 | #define MCFINT_QSPI 31 /* Interrupt number for QSPI */ | 31 | #define MCFINT_QSPI 31 /* Interrupt number for QSPI */ |
32 | #define MCFINT_PIT1 4 /* Interrupt number for PIT1 (PIT0 in processor) */ | 32 | #define MCFINT_PIT1 4 /* Interrupt number for PIT1 (PIT0 in processor) */ |
33 | 33 | ||
34 | /* | ||
35 | * SDRAM configuration registers. | ||
36 | */ | ||
37 | #define MCFSIM_SDMR 0x000a8000 /* SDRAM Mode/Extended Mode Register */ | ||
38 | #define MCFSIM_SDCR 0x000a8004 /* SDRAM Control Register */ | ||
39 | #define MCFSIM_SDCFG1 0x000a8008 /* SDRAM Configuration Register 1 */ | ||
40 | #define MCFSIM_SDCFG2 0x000a800c /* SDRAM Configuration Register 2 */ | ||
41 | #define MCFSIM_SDCS0 0x000a8110 /* SDRAM Chip Select 0 Configuration */ | ||
42 | #define MCFSIM_SDCS1 0x000a8114 /* SDRAM Chip Select 1 Configuration */ | ||
43 | |||
34 | 44 | ||
35 | #define MCF_GPIO_PAR_UART (0xA4036) | 45 | #define MCF_GPIO_PAR_UART (0xA4036) |
36 | #define MCF_GPIO_PAR_FECI2C (0xA4033) | 46 | #define MCF_GPIO_PAR_FECI2C (0xA4033) |
@@ -47,7 +57,7 @@ | |||
47 | 57 | ||
48 | #define ICR_INTRCONF 0x05 | 58 | #define ICR_INTRCONF 0x05 |
49 | #define MCFPIT_IMR MCFINTC_IMRL | 59 | #define MCFPIT_IMR MCFINTC_IMRL |
50 | #define MCFPIT_IMR_IBIT (1 << MCFINT_PIT1) | 60 | #define MCFPIT_IMR_IBIT (1 << MCFINT_PIT1) |
51 | 61 | ||
52 | /****************************************************************************/ | 62 | /****************************************************************************/ |
53 | #endif /* m520xsim_h */ | 63 | #endif /* m520xsim_h */ |
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h index 27c90afd3339..6ce28f8e0ead 100644 --- a/include/asm-m68knommu/machdep.h +++ b/include/asm-m68knommu/machdep.h | |||
@@ -18,7 +18,7 @@ extern int (*mach_kbdrate) (struct kbd_repeat *); | |||
18 | extern void (*mach_kbd_leds) (unsigned int); | 18 | extern void (*mach_kbd_leds) (unsigned int); |
19 | /* machine dependent irq functions */ | 19 | /* machine dependent irq functions */ |
20 | extern void (*mach_init_IRQ) (void); | 20 | extern void (*mach_init_IRQ) (void); |
21 | extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); | 21 | extern irq_handler_t mach_default_handler; |
22 | extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), | 22 | extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), |
23 | unsigned long flags, const char *devname, void *dev_id); | 23 | unsigned long flags, const char *devname, void *dev_id); |
24 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); | 24 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); |
diff --git a/include/asm-m68knommu/mcfmbus.h b/include/asm-m68knommu/mcfmbus.h index 13df9d41bd1a..319899c47a2c 100644 --- a/include/asm-m68knommu/mcfmbus.h +++ b/include/asm-m68knommu/mcfmbus.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/ | 37 | #define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/ |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Define bit flags in Controll Register | 40 | * Define bit flags in Control Register |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */ | 43 | #define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */ |
diff --git a/include/asm-m68knommu/rtc.h b/include/asm-m68knommu/rtc.h new file mode 100644 index 000000000000..eaf18ec83c8e --- /dev/null +++ b/include/asm-m68knommu/rtc.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-m68k/rtc.h> | |||
diff --git a/include/asm-m68knommu/scatterlist.h b/include/asm-m68knommu/scatterlist.h index 12309b181d29..2085d6ff8782 100644 --- a/include/asm-m68knommu/scatterlist.h +++ b/include/asm-m68knommu/scatterlist.h | |||
@@ -10,7 +10,7 @@ struct scatterlist { | |||
10 | unsigned int length; | 10 | unsigned int length; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | #define sg_address(sg) (page_address((sg)->page) + (sg)->offset | 13 | #define sg_address(sg) (page_address((sg)->page) + (sg)->offset) |
14 | #define sg_dma_address(sg) ((sg)->dma_address) | 14 | #define sg_dma_address(sg) ((sg)->dma_address) |
15 | #define sg_dma_len(sg) ((sg)->length) | 15 | #define sg_dma_len(sg) ((sg)->length) |
16 | 16 | ||
diff --git a/include/asm-m68knommu/setup.h b/include/asm-m68knommu/setup.h index d2b0fcce41b2..fb86bb2a6078 100644 --- a/include/asm-m68knommu/setup.h +++ b/include/asm-m68knommu/setup.h | |||
@@ -1,5 +1,10 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | |||
1 | #include <asm-m68k/setup.h> | 3 | #include <asm-m68k/setup.h> |
2 | 4 | ||
3 | /* We have a bigger command line buffer. */ | 5 | /* We have a bigger command line buffer. */ |
4 | #undef COMMAND_LINE_SIZE | 6 | #undef COMMAND_LINE_SIZE |
7 | |||
8 | #endif /* __KERNEL__ */ | ||
9 | |||
5 | #define COMMAND_LINE_SIZE 512 | 10 | #define COMMAND_LINE_SIZE 512 |
diff --git a/include/asm-m68knommu/ucontext.h b/include/asm-m68knommu/ucontext.h index 5d570cedbb02..713a27f901cd 100644 --- a/include/asm-m68knommu/ucontext.h +++ b/include/asm-m68knommu/ucontext.h | |||
@@ -5,21 +5,17 @@ typedef int greg_t; | |||
5 | #define NGREG 18 | 5 | #define NGREG 18 |
6 | typedef greg_t gregset_t[NGREG]; | 6 | typedef greg_t gregset_t[NGREG]; |
7 | 7 | ||
8 | #ifdef CONFIG_FPU | ||
9 | typedef struct fpregset { | 8 | typedef struct fpregset { |
10 | int f_pcr; | 9 | int f_pcr; |
11 | int f_psr; | 10 | int f_psr; |
12 | int f_fpiaddr; | 11 | int f_fpiaddr; |
13 | int f_fpregs[8][3]; | 12 | int f_fpregs[8][3]; |
14 | } fpregset_t; | 13 | } fpregset_t; |
15 | #endif | ||
16 | 14 | ||
17 | struct mcontext { | 15 | struct mcontext { |
18 | int version; | 16 | int version; |
19 | gregset_t gregs; | 17 | gregset_t gregs; |
20 | #ifdef CONFIG_FPU | ||
21 | fpregset_t fpregs; | 18 | fpregset_t fpregs; |
22 | #endif | ||
23 | }; | 19 | }; |
24 | 20 | ||
25 | #define MCONTEXT_VERSION 2 | 21 | #define MCONTEXT_VERSION 2 |
@@ -29,9 +25,7 @@ struct ucontext { | |||
29 | struct ucontext *uc_link; | 25 | struct ucontext *uc_link; |
30 | stack_t uc_stack; | 26 | stack_t uc_stack; |
31 | struct mcontext uc_mcontext; | 27 | struct mcontext uc_mcontext; |
32 | #ifdef CONFIG_FPU | ||
33 | unsigned long uc_filler[80]; | 28 | unsigned long uc_filler[80]; |
34 | #endif | ||
35 | sigset_t uc_sigmask; /* mask last for extensibility */ | 29 | sigset_t uc_sigmask; /* mask last for extensibility */ |
36 | }; | 30 | }; |
37 | 31 | ||
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h index ebaf03197114..82e03195f325 100644 --- a/include/asm-m68knommu/unistd.h +++ b/include/asm-m68knommu/unistd.h | |||
@@ -318,156 +318,6 @@ | |||
318 | #ifdef __KERNEL__ | 318 | #ifdef __KERNEL__ |
319 | 319 | ||
320 | #define NR_syscalls 311 | 320 | #define NR_syscalls 311 |
321 | #include <linux/err.h> | ||
322 | |||
323 | /* user-visible error numbers are in the range -1 - -MAX_ERRNO: see | ||
324 | <asm-m68k/errno.h> */ | ||
325 | |||
326 | #define __syscall_return(type, res) \ | ||
327 | do { \ | ||
328 | if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \ | ||
329 | /* avoid using res which is declared to be in register d0; \ | ||
330 | errno might expand to a function call and clobber it. */ \ | ||
331 | int __err = -(res); \ | ||
332 | errno = __err; \ | ||
333 | res = -1; \ | ||
334 | } \ | ||
335 | return (type) (res); \ | ||
336 | } while (0) | ||
337 | |||
338 | #define _syscall0(type, name) \ | ||
339 | type name(void) \ | ||
340 | { \ | ||
341 | long __res; \ | ||
342 | __asm__ __volatile__ ("movel %1, %%d0\n\t" \ | ||
343 | "trap #0\n\t" \ | ||
344 | "movel %%d0, %0" \ | ||
345 | : "=g" (__res) \ | ||
346 | : "i" (__NR_##name) \ | ||
347 | : "cc", "%d0"); \ | ||
348 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
349 | errno = -__res; \ | ||
350 | __res = -1; \ | ||
351 | } \ | ||
352 | return (type)__res; \ | ||
353 | } | ||
354 | |||
355 | #define _syscall1(type, name, atype, a) \ | ||
356 | type name(atype a) \ | ||
357 | { \ | ||
358 | long __res; \ | ||
359 | __asm__ __volatile__ ("movel %2, %%d1\n\t" \ | ||
360 | "movel %1, %%d0\n\t" \ | ||
361 | "trap #0\n\t" \ | ||
362 | "movel %%d0, %0" \ | ||
363 | : "=g" (__res) \ | ||
364 | : "i" (__NR_##name), \ | ||
365 | "g" ((long)a) \ | ||
366 | : "cc", "%d0", "%d1"); \ | ||
367 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
368 | errno = -__res; \ | ||
369 | __res = -1; \ | ||
370 | } \ | ||
371 | return (type)__res; \ | ||
372 | } | ||
373 | |||
374 | #define _syscall2(type, name, atype, a, btype, b) \ | ||
375 | type name(atype a, btype b) \ | ||
376 | { \ | ||
377 | long __res; \ | ||
378 | __asm__ __volatile__ ("movel %3, %%d2\n\t" \ | ||
379 | "movel %2, %%d1\n\t" \ | ||
380 | "movel %1, %%d0\n\t" \ | ||
381 | "trap #0\n\t" \ | ||
382 | "movel %%d0, %0" \ | ||
383 | : "=g" (__res) \ | ||
384 | : "i" (__NR_##name), \ | ||
385 | "a" ((long)a), \ | ||
386 | "g" ((long)b) \ | ||
387 | : "cc", "%d0", "%d1", "%d2"); \ | ||
388 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
389 | errno = -__res; \ | ||
390 | __res = -1; \ | ||
391 | } \ | ||
392 | return (type)__res; \ | ||
393 | } | ||
394 | |||
395 | #define _syscall3(type, name, atype, a, btype, b, ctype, c) \ | ||
396 | type name(atype a, btype b, ctype c) \ | ||
397 | { \ | ||
398 | long __res; \ | ||
399 | __asm__ __volatile__ ("movel %4, %%d3\n\t" \ | ||
400 | "movel %3, %%d2\n\t" \ | ||
401 | "movel %2, %%d1\n\t" \ | ||
402 | "movel %1, %%d0\n\t" \ | ||
403 | "trap #0\n\t" \ | ||
404 | "movel %%d0, %0" \ | ||
405 | : "=g" (__res) \ | ||
406 | : "i" (__NR_##name), \ | ||
407 | "a" ((long)a), \ | ||
408 | "a" ((long)b), \ | ||
409 | "g" ((long)c) \ | ||
410 | : "cc", "%d0", "%d1", "%d2", "%d3"); \ | ||
411 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
412 | errno = -__res; \ | ||
413 | __res = -1; \ | ||
414 | } \ | ||
415 | return (type)__res; \ | ||
416 | } | ||
417 | |||
418 | #define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \ | ||
419 | type name(atype a, btype b, ctype c, dtype d) \ | ||
420 | { \ | ||
421 | long __res; \ | ||
422 | __asm__ __volatile__ ("movel %5, %%d4\n\t" \ | ||
423 | "movel %4, %%d3\n\t" \ | ||
424 | "movel %3, %%d2\n\t" \ | ||
425 | "movel %2, %%d1\n\t" \ | ||
426 | "movel %1, %%d0\n\t" \ | ||
427 | "trap #0\n\t" \ | ||
428 | "movel %%d0, %0" \ | ||
429 | : "=g" (__res) \ | ||
430 | : "i" (__NR_##name), \ | ||
431 | "a" ((long)a), \ | ||
432 | "a" ((long)b), \ | ||
433 | "a" ((long)c), \ | ||
434 | "g" ((long)d) \ | ||
435 | : "cc", "%d0", "%d1", "%d2", "%d3", \ | ||
436 | "%d4"); \ | ||
437 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
438 | errno = -__res; \ | ||
439 | __res = -1; \ | ||
440 | } \ | ||
441 | return (type)__res; \ | ||
442 | } | ||
443 | |||
444 | #define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e) \ | ||
445 | type name(atype a, btype b, ctype c, dtype d, etype e) \ | ||
446 | { \ | ||
447 | long __res; \ | ||
448 | __asm__ __volatile__ ("movel %6, %%d5\n\t" \ | ||
449 | "movel %5, %%d4\n\t" \ | ||
450 | "movel %4, %%d3\n\t" \ | ||
451 | "movel %3, %%d2\n\t" \ | ||
452 | "movel %2, %%d1\n\t" \ | ||
453 | "movel %1, %%d0\n\t" \ | ||
454 | "trap #0\n\t" \ | ||
455 | "movel %%d0, %0" \ | ||
456 | : "=g" (__res) \ | ||
457 | : "i" (__NR_##name), \ | ||
458 | "a" ((long)a), \ | ||
459 | "a" ((long)b), \ | ||
460 | "a" ((long)c), \ | ||
461 | "a" ((long)d), \ | ||
462 | "g" ((long)e) \ | ||
463 | : "cc", "%d0", "%d1", "%d2", "%d3", \ | ||
464 | "%d4", "%d5"); \ | ||
465 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | ||
466 | errno = -__res; \ | ||
467 | __res = -1; \ | ||
468 | } \ | ||
469 | return (type)__res; \ | ||
470 | } | ||
471 | 321 | ||
472 | #define __ARCH_WANT_IPC_PARSE_VERSION | 322 | #define __ARCH_WANT_IPC_PARSE_VERSION |
473 | #define __ARCH_WANT_OLD_READDIR | 323 | #define __ARCH_WANT_OLD_READDIR |