[PATCH] h8300 header update

- page.h: fix build error
- unistd.h: _syscall macro cleanup.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Yoshinori Sato 2005-04-16 15:25:21 -07:00 committed by Linus Torvalds
parent d31ddaa172
commit 74ad74c158
2 changed files with 139 additions and 147 deletions

View File

@ -79,7 +79,7 @@ extern unsigned long memory_end;
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define __pa(vaddr) virt_to_phys((void *)vaddr) #define __pa(vaddr) virt_to_phys(vaddr)
#define __va(paddr) phys_to_virt((unsigned long)paddr) #define __va(paddr) phys_to_virt((unsigned long)paddr)
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
@ -89,7 +89,7 @@ extern unsigned long memory_end;
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) #define pfn_valid(page) (page < max_mapnr)
#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) #define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) #define page_to_pfn(page) virt_to_pfn(page_to_virt(page))

View File

@ -310,163 +310,155 @@ do { \
return (type) (res); \ return (type) (res); \
} while (0) } while (0)
#define _syscall0(type, name) \ #define _syscall0(type, name) \
type name(void) \ type name(void) \
{ \ { \
register long __res __asm__("er0"); \ register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \ "trapa #0\n\t" \
: "=r" (__res) \ : "=r" (__res) \
: "ir" (__NR_##name) \ : "g" (__NR_##name) \
: "cc"); \ : "cc", "memory"); \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ __syscall_return(type, __res); \
errno = -__res; \
__res = -1; \
} \
return (type)__res; \
} }
#define _syscall1(type, name, atype, a) \ #define _syscall1(type, name, atype, a) \
type name(atype a) \ type name(atype a) \
{ \ { \
register long __res __asm__("er0"); \ register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l %2, er1\n\t" \ register long _a __asm__("er1"); \
"mov.l %1, er0\n\t" \ _a = (long)a; \
"trapa #0\n\t" \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
: "=r" (__res) \ "trapa #0\n\t" \
: "ir" (__NR_##name), \ : "=r" (__res) \
"g" ((long)a) \ : "g" (__NR_##name), \
: "cc", "er1"); \ "g" (_a) \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ : "cc", "memory"); \
errno = -__res; \ __syscall_return(type, __res); \
__res = -1; \
} \
return (type)__res; \
} }
#define _syscall2(type, name, atype, a, btype, b) \ #define _syscall2(type, name, atype, a, btype, b) \
type name(atype a, btype b) \ type name(atype a, btype b) \
{ \ { \
register long __res __asm__("er0"); \ register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l %3, er2\n\t" \ register long _a __asm__("er1"); \
"mov.l %2, er1\n\t" \ register long _b __asm__("er2"); \
"mov.l %1, er0\n\t" \ _a = (long)a; \
"trapa #0\n\t" \ _b = (long)b; \
: "=r" (__res) \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
: "ir" (__NR_##name), \ "trapa #0\n\t" \
"g" ((long)a), \ : "=r" (__res) \
"g" ((long)b) \ : "g" (__NR_##name), \
: "cc", "er1", "er2"); \ "g" (_a), \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ "g" (_b) \
errno = -__res; \ : "cc", "memory"); \
__res = -1; \ __syscall_return(type, __res); \
} \
return (type)__res; \
} }
#define _syscall3(type, name, atype, a, btype, b, ctype, c) \ #define _syscall3(type, name, atype, a, btype, b, ctype, c) \
type name(atype a, btype b, ctype c) \ type name(atype a, btype b, ctype c) \
{ \ { \
register long __res __asm__("er0"); \ register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l %4, er3\n\t" \ register long _a __asm__("er1"); \
"mov.l %3, er2\n\t" \ register long _b __asm__("er2"); \
"mov.l %2, er1\n\t" \ register long _c __asm__("er3"); \
"mov.l %1, er0\n\t" \ _a = (long)a; \
"trapa #0\n\t" \ _b = (long)b; \
: "=r" (__res) \ _c = (long)c; \
: "ir" (__NR_##name), \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
"g" ((long)a), \ "trapa #0\n\t" \
"g" ((long)b), \ : "=r" (__res) \
"g" ((long)c) \ : "g" (__NR_##name), \
: "cc", "er1", "er2", "er3"); \ "g" (_a), \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ "g" (_b), \
errno = -__res; \ "g" (_c) \
__res = -1; \ : "cc", "memory"); \
} \ __syscall_return(type, __res); \
return (type)__res; \
} }
#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \ #define _syscall4(type, name, atype, a, btype, b, \
type name(atype a, btype b, ctype c, dtype d) \ ctype, c, dtype, d) \
{ \ type name(atype a, btype b, ctype c, dtype d) \
register long __res __asm__("er0"); \ { \
__asm__ __volatile__ ("mov.l %5, er4\n\t" \ register long __res __asm__("er0"); \
"mov.l %4, er3\n\t" \ register long _a __asm__("er1"); \
"mov.l %3, er2\n\t" \ register long _b __asm__("er2"); \
"mov.l %2, er1\n\t" \ register long _c __asm__("er3"); \
"mov.l %1, er0\n\t" \ register long _d __asm__("er4"); \
"trapa #0\n\t" \ _a = (long)a; \
: "=r" (__res) \ _b = (long)b; \
: "ir" (__NR_##name), \ _c = (long)c; \
"g" ((long)a), \ _d = (long)d; \
"g" ((long)b), \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
"g" ((long)c), \ "trapa #0\n\t" \
"g" ((long)d) \ : "=r" (__res) \
: "cc", "er1", "er2", "er3", "er4"); \ : "g" (__NR_##name), \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ "g" (_a), \
errno = -__res; \ "g" (_b), \
__res = -1; \ "g" (_c), \
} \ "g" (_d) \
return (type)__res; \ : "cc", "memory"); \
__syscall_return(type, __res); \
} }
#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e) \ #define _syscall5(type, name, atype, a, btype, b, \
type name(atype a, btype b, ctype c, dtype d, etype e) \ ctype, c, dtype, d, etype, e) \
{ \ type name(atype a, btype b, ctype c, dtype d, etype e) \
register long __res __asm__("er0"); \ { \
__asm__ __volatile__ ("mov.l %6, er5\n\t" \ register long __res __asm__("er0"); \
"mov.l %5, er4\n\t" \ register long _a __asm__("er1"); \
"mov.l %4, er3\n\t" \ register long _b __asm__("er2"); \
"mov.l %3, er2\n\t" \ register long _c __asm__("er3"); \
"mov.l %2, er1\n\t" \ register long _d __asm__("er4"); \
"mov.l %1, er0\n\t" \ register long _e __asm__("er5"); \
"trapa #0\n\t" \ _a = (long)a; \
: "=r" (__res) \ _b = (long)b; \
: "ir" (__NR_##name), \ _c = (long)c; \
"g" ((long)a), \ _d = (long)d; \
"g" ((long)b), \ _e = (long)e; \
"g" ((long)c), \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
"g" ((long)d), \ "trapa #0\n\t" \
"m" ((long)e) \ : "=r" (__res) \
: "cc", "er1", "er2", "er3", "er4", "er5"); \ : "g" (__NR_##name), \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ "g" (_a), \
errno = -__res; \ "g" (_b), \
__res = -1; \ "g" (_c), \
} \ "g" (_d), \
return (type)__res; \ "g" (_e) \
: "cc", "memory"); \
__syscall_return(type, __res); \
} }
#define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, \ #define _syscall6(type, name, atype, a, btype, b, \
etype, e, ftype, f) \ ctype, c, dtype, d, etype, e, ftype, f) \
type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \
{ \ { \
register long __res __asm__("er0"); \ register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l er6,@-sp\n\t" \ register long _a __asm__("er1"); \
"mov.l %7, er6\n\t" \ register long _b __asm__("er2"); \
"mov.l %6, er5\n\t" \ register long _c __asm__("er3"); \
"mov.l %5, er4\n\t" \ register long _d __asm__("er4"); \
"mov.l %4, er3\n\t" \ register long _e __asm__("er5"); \
"mov.l %3, er2\n\t" \ register long _f __asm__("er6"); \
"mov.l %2, er1\n\t" \ _a = (long)a; \
"mov.l %1, er0\n\t" \ _b = (long)b; \
"trapa #0\n\t" \ _c = (long)c; \
"mov.l @sp+,er6" \ _d = (long)d; \
: "=r" (__res) \ _e = (long)e; \
: "ir" (__NR_##name), \ _f = (long)f; \
"g" ((long)a), \ __asm__ __volatile__ ("mov.l %1,er0\n\t" \
"g" ((long)b), \ "trapa #0\n\t" \
"g" ((long)c), \ : "=r" (__res) \
"g" ((long)d), \ : "g" (__NR_##name), \
"m" ((long)e), \ "g" (_a), \
"m" ((long)e) \ "g" (_b), \
: "cc", "er1", "er2", "er3", "er4", "er5"); \ "g" (_c), \
if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ "g" (_d), \
errno = -__res; \ "g" (_e) \
__res = -1; \ "g" (_f) \
} \ : "cc", "memory"); \
return (type)__res; \ __syscall_return(type, __res); \
} }
#ifdef __KERNEL__ #ifdef __KERNEL__
#define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_IPC_PARSE_VERSION