aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/Kbuild2
-rw-r--r--include/asm-x86/a.out-core.h71
-rw-r--r--include/asm-x86/a.out.h10
-rw-r--r--include/asm-x86/cmpxchg_64.h22
-rw-r--r--include/asm-x86/delay.h2
-rw-r--r--include/asm-x86/elf.h3
-rw-r--r--include/asm-x86/mmzone_32.h4
-rw-r--r--include/asm-x86/page_32.h2
-rw-r--r--include/asm-x86/page_64.h2
-rw-r--r--include/asm-x86/pgalloc_32.h6
-rw-r--r--include/asm-x86/pgalloc_64.h32
-rw-r--r--include/asm-x86/posix_types_32.h8
-rw-r--r--include/asm-x86/processor.h5
-rw-r--r--include/asm-x86/termios.h74
-rw-r--r--include/asm-x86/timex.h3
-rw-r--r--include/asm-x86/user.h14
-rw-r--r--include/asm-x86/user_32.h2
-rw-r--r--include/asm-x86/user_64.h2
18 files changed, 179 insertions, 85 deletions
diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild
index 3c6f0f80e827..b04a7ff46df1 100644
--- a/include/asm-x86/Kbuild
+++ b/include/asm-x86/Kbuild
@@ -22,7 +22,5 @@ unifdef-y += posix_types_64.h
22unifdef-y += ptrace.h 22unifdef-y += ptrace.h
23unifdef-y += unistd_32.h 23unifdef-y += unistd_32.h
24unifdef-y += unistd_64.h 24unifdef-y += unistd_64.h
25unifdef-y += user_32.h
26unifdef-y += user_64.h
27unifdef-y += vm86.h 25unifdef-y += vm86.h
28unifdef-y += vsyscall.h 26unifdef-y += vsyscall.h
diff --git a/include/asm-x86/a.out-core.h b/include/asm-x86/a.out-core.h
new file mode 100644
index 000000000000..d2b6e11d3e97
--- /dev/null
+++ b/include/asm-x86/a.out-core.h
@@ -0,0 +1,71 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16#ifdef CONFIG_X86_32
17
18#include <linux/user.h>
19#include <linux/elfcore.h>
20
21/*
22 * fill in the user structure for an a.out core dump
23 */
24static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
25{
26 u16 gs;
27
28/* changed the size calculations - should hopefully work better. lbt */
29 dump->magic = CMAGIC;
30 dump->start_code = 0;
31 dump->start_stack = regs->sp & ~(PAGE_SIZE - 1);
32 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
33 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
34 dump->u_dsize -= dump->u_tsize;
35 dump->u_ssize = 0;
36 dump->u_debugreg[0] = current->thread.debugreg0;
37 dump->u_debugreg[1] = current->thread.debugreg1;
38 dump->u_debugreg[2] = current->thread.debugreg2;
39 dump->u_debugreg[3] = current->thread.debugreg3;
40 dump->u_debugreg[4] = 0;
41 dump->u_debugreg[5] = 0;
42 dump->u_debugreg[6] = current->thread.debugreg6;
43 dump->u_debugreg[7] = current->thread.debugreg7;
44
45 if (dump->start_stack < TASK_SIZE)
46 dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
47
48 dump->regs.bx = regs->bx;
49 dump->regs.cx = regs->cx;
50 dump->regs.dx = regs->dx;
51 dump->regs.si = regs->si;
52 dump->regs.di = regs->di;
53 dump->regs.bp = regs->bp;
54 dump->regs.ax = regs->ax;
55 dump->regs.ds = (u16)regs->ds;
56 dump->regs.es = (u16)regs->es;
57 dump->regs.fs = (u16)regs->fs;
58 savesegment(gs,gs);
59 dump->regs.orig_ax = regs->orig_ax;
60 dump->regs.ip = regs->ip;
61 dump->regs.cs = (u16)regs->cs;
62 dump->regs.flags = regs->flags;
63 dump->regs.sp = regs->sp;
64 dump->regs.ss = (u16)regs->ss;
65
66 dump->u_fpvalid = dump_fpu (regs, &dump->i387);
67}
68
69#endif /* CONFIG_X86_32 */
70#endif /* __KERNEL__ */
71#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-x86/a.out.h b/include/asm-x86/a.out.h
index a62443e38eb8..4684f97a5bbd 100644
--- a/include/asm-x86/a.out.h
+++ b/include/asm-x86/a.out.h
@@ -17,14 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21# include <linux/thread_info.h>
22# define STACK_TOP TASK_SIZE
23# ifdef CONFIG_X86_32
24# define STACK_TOP_MAX STACK_TOP
25# else
26# define STACK_TOP_MAX TASK_SIZE64
27# endif
28#endif
29
30#endif /* _ASM_X86_A_OUT_H */ 20#endif /* _ASM_X86_A_OUT_H */
diff --git a/include/asm-x86/cmpxchg_64.h b/include/asm-x86/cmpxchg_64.h
index 5e182062e6ec..56f5b41e071c 100644
--- a/include/asm-x86/cmpxchg_64.h
+++ b/include/asm-x86/cmpxchg_64.h
@@ -124,11 +124,21 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
124 return old; 124 return old;
125} 125}
126 126
127#define cmpxchg(ptr,o,n)\ 127#define cmpxchg(ptr, o, n) \
128 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 128 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
129 (unsigned long)(n),sizeof(*(ptr)))) 129 (unsigned long)(n), sizeof(*(ptr))))
130#define cmpxchg_local(ptr,o,n)\ 130#define cmpxchg64(ptr, o, n) \
131 ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\ 131 ({ \
132 (unsigned long)(n),sizeof(*(ptr)))) 132 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
133 cmpxchg((ptr), (o), (n)); \
134 })
135#define cmpxchg_local(ptr, o, n) \
136 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
137 (unsigned long)(n), sizeof(*(ptr))))
138#define cmpxchg64_local(ptr, o, n) \
139 ({ \
140 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
141 cmpxchg_local((ptr), (o), (n)); \
142 })
133 143
134#endif 144#endif
diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h
index d11d47fc1a0e..409a649204aa 100644
--- a/include/asm-x86/delay.h
+++ b/include/asm-x86/delay.h
@@ -13,7 +13,7 @@ extern void __bad_ndelay(void);
13 13
14extern void __udelay(unsigned long usecs); 14extern void __udelay(unsigned long usecs);
15extern void __ndelay(unsigned long nsecs); 15extern void __ndelay(unsigned long nsecs);
16extern void __const_udelay(unsigned long usecs); 16extern void __const_udelay(unsigned long xloops);
17extern void __delay(unsigned long loops); 17extern void __delay(unsigned long loops);
18 18
19/* 0x10c7 is 2**32 / 1000000 (rounded up) */ 19/* 0x10c7 is 2**32 / 1000000 (rounded up) */
diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h
index d9c94e707289..fb62f9941e38 100644
--- a/include/asm-x86/elf.h
+++ b/include/asm-x86/elf.h
@@ -72,7 +72,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
72 72
73#endif 73#endif
74 74
75#ifdef __KERNEL__
76#include <asm/vdso.h> 75#include <asm/vdso.h>
77 76
78extern unsigned int vdso_enabled; 77extern unsigned int vdso_enabled;
@@ -321,6 +320,4 @@ extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
321extern unsigned long arch_randomize_brk(struct mm_struct *mm); 320extern unsigned long arch_randomize_brk(struct mm_struct *mm);
322#define arch_randomize_brk arch_randomize_brk 321#define arch_randomize_brk arch_randomize_brk
323 322
324#endif /* __KERNEL__ */
325
326#endif 323#endif
diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index 5d6f4ce6e6d6..274a59566c45 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -107,8 +107,8 @@ static inline int pfn_valid(int pfn)
107/* 107/*
108 * Following are macros that are specific to this numa platform. 108 * Following are macros that are specific to this numa platform.
109 */ 109 */
110#define reserve_bootmem(addr, size) \ 110#define reserve_bootmem(addr, size, flags) \
111 reserve_bootmem_node(NODE_DATA(0), (addr), (size)) 111 reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
112#define alloc_bootmem(x) \ 112#define alloc_bootmem(x) \
113 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 113 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
114#define alloc_bootmem_low(x) \ 114#define alloc_bootmem_low(x) \
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h
index a6fd10f230d2..ba715d9798b0 100644
--- a/include/asm-x86/page_32.h
+++ b/include/asm-x86/page_32.h
@@ -50,6 +50,8 @@ typedef unsigned long phys_addr_t;
50typedef union { pteval_t pte, pte_low; } pte_t; 50typedef union { pteval_t pte, pte_low; } pte_t;
51typedef pte_t boot_pte_t; 51typedef pte_t boot_pte_t;
52 52
53typedef struct page *pgtable_t;
54
53#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
54#endif /* CONFIG_X86_PAE */ 56#endif /* CONFIG_X86_PAE */
55 57
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index dcf0c0746075..f7393bc516ef 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -71,6 +71,8 @@ typedef unsigned long pgdval_t;
71typedef unsigned long pgprotval_t; 71typedef unsigned long pgprotval_t;
72typedef unsigned long phys_addr_t; 72typedef unsigned long phys_addr_t;
73 73
74typedef struct page *pgtable_t;
75
74typedef struct { pteval_t pte; } pte_t; 76typedef struct { pteval_t pte; } pte_t;
75 77
76#define vmemmap ((struct page *)VMEMMAP_START) 78#define vmemmap ((struct page *)VMEMMAP_START)
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h
index bab12718a913..6bea6e5b5ee5 100644
--- a/include/asm-x86/pgalloc_32.h
+++ b/include/asm-x86/pgalloc_32.h
@@ -31,6 +31,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
31 paravirt_alloc_pt(mm, pfn); 31 paravirt_alloc_pt(mm, pfn);
32 set_pmd(pmd, __pmd(((pteval_t)pfn << PAGE_SHIFT) | _PAGE_TABLE)); 32 set_pmd(pmd, __pmd(((pteval_t)pfn << PAGE_SHIFT) | _PAGE_TABLE));
33} 33}
34#define pmd_pgtable(pmd) pmd_page(pmd)
34 35
35/* 36/*
36 * Allocate and free page tables. 37 * Allocate and free page tables.
@@ -39,15 +40,16 @@ extern pgd_t *pgd_alloc(struct mm_struct *);
39extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 40extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
40 41
41extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); 42extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
42extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); 43extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long);
43 44
44static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 45static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
45{ 46{
46 free_page((unsigned long)pte); 47 free_page((unsigned long)pte);
47} 48}
48 49
49static inline void pte_free(struct mm_struct *mm, struct page *pte) 50static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
50{ 51{
52 pgtable_page_dtor(pte);
51 __free_page(pte); 53 __free_page(pte);
52} 54}
53 55
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 315314ce4bfb..8d6722320dcc 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -12,6 +12,8 @@
12#define pgd_populate(mm, pgd, pud) \ 12#define pgd_populate(mm, pgd, pud) \
13 set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))) 13 set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)))
14 14
15#define pmd_pgtable(pmd) pmd_page(pmd)
16
15static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte) 17static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
16{ 18{
17 set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); 19 set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT)));
@@ -42,19 +44,21 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
42static inline void pgd_list_add(pgd_t *pgd) 44static inline void pgd_list_add(pgd_t *pgd)
43{ 45{
44 struct page *page = virt_to_page(pgd); 46 struct page *page = virt_to_page(pgd);
47 unsigned long flags;
45 48
46 spin_lock(&pgd_lock); 49 spin_lock_irqsave(&pgd_lock, flags);
47 list_add(&page->lru, &pgd_list); 50 list_add(&page->lru, &pgd_list);
48 spin_unlock(&pgd_lock); 51 spin_unlock_irqrestore(&pgd_lock, flags);
49} 52}
50 53
51static inline void pgd_list_del(pgd_t *pgd) 54static inline void pgd_list_del(pgd_t *pgd)
52{ 55{
53 struct page *page = virt_to_page(pgd); 56 struct page *page = virt_to_page(pgd);
57 unsigned long flags;
54 58
55 spin_lock(&pgd_lock); 59 spin_lock_irqsave(&pgd_lock, flags);
56 list_del(&page->lru); 60 list_del(&page->lru);
57 spin_unlock(&pgd_lock); 61 spin_unlock_irqrestore(&pgd_lock, flags);
58} 62}
59 63
60static inline pgd_t *pgd_alloc(struct mm_struct *mm) 64static inline pgd_t *pgd_alloc(struct mm_struct *mm)
@@ -89,12 +93,17 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad
89 return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 93 return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
90} 94}
91 95
92static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 96static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
93{ 97{
94 void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 98 struct page *page;
99 void *p;
100
101 p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
95 if (!p) 102 if (!p)
96 return NULL; 103 return NULL;
97 return virt_to_page(p); 104 page = virt_to_page(p);
105 pgtable_page_ctor(page);
106 return page;
98} 107}
99 108
100/* Should really implement gc for free page table pages. This could be 109/* Should really implement gc for free page table pages. This could be
@@ -106,12 +115,17 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
106 free_page((unsigned long)pte); 115 free_page((unsigned long)pte);
107} 116}
108 117
109static inline void pte_free(struct mm_struct *mm, struct page *pte) 118static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
110{ 119{
120 pgtable_page_dtor(pte);
111 __free_page(pte); 121 __free_page(pte);
112} 122}
113 123
114#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 124#define __pte_free_tlb(tlb,pte) \
125do { \
126 pgtable_page_dtor((pte)); \
127 tlb_remove_page((tlb), (pte)); \
128} while (0)
115 129
116#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 130#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
117#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 131#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
diff --git a/include/asm-x86/posix_types_32.h b/include/asm-x86/posix_types_32.h
index 133e31e7dfde..015e539cdef5 100644
--- a/include/asm-x86/posix_types_32.h
+++ b/include/asm-x86/posix_types_32.h
@@ -39,14 +39,10 @@ typedef long long __kernel_loff_t;
39#endif 39#endif
40 40
41typedef struct { 41typedef struct {
42#if defined(__KERNEL__) || defined(__USE_ALL)
43 int val[2]; 42 int val[2];
44#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
45 int __val[2];
46#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
47} __kernel_fsid_t; 43} __kernel_fsid_t;
48 44
49#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 45#if defined(__KERNEL__)
50 46
51#undef __FD_SET 47#undef __FD_SET
52#define __FD_SET(fd,fdsetp) \ 48#define __FD_SET(fd,fdsetp) \
@@ -77,6 +73,6 @@ do { \
77 "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \ 73 "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
78} while (0) 74} while (0)
79 75
80#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ 76#endif /* defined(__KERNEL__) */
81 77
82#endif 78#endif
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index ab4d0c2a3f8f..149920dcd341 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -719,6 +719,8 @@ static inline void prefetchw(const void *x)
719 * User space process size: 3GB (default). 719 * User space process size: 3GB (default).
720 */ 720 */
721#define TASK_SIZE (PAGE_OFFSET) 721#define TASK_SIZE (PAGE_OFFSET)
722#define STACK_TOP TASK_SIZE
723#define STACK_TOP_MAX STACK_TOP
722 724
723#define INIT_THREAD { \ 725#define INIT_THREAD { \
724 .sp0 = sizeof(init_stack) + (long)&init_stack, \ 726 .sp0 = sizeof(init_stack) + (long)&init_stack, \
@@ -802,6 +804,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
802#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ 804#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \
803 IA32_PAGE_OFFSET : TASK_SIZE64) 805 IA32_PAGE_OFFSET : TASK_SIZE64)
804 806
807#define STACK_TOP TASK_SIZE
808#define STACK_TOP_MAX TASK_SIZE64
809
805#define INIT_THREAD { \ 810#define INIT_THREAD { \
806 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 811 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \
807} 812}
diff --git a/include/asm-x86/termios.h b/include/asm-x86/termios.h
index d501748700d2..f72956331c49 100644
--- a/include/asm-x86/termios.h
+++ b/include/asm-x86/termios.h
@@ -41,6 +41,8 @@ struct termio {
41 41
42#ifdef __KERNEL__ 42#ifdef __KERNEL__
43 43
44#include <asm/uaccess.h>
45
44/* intr=^C quit=^\ erase=del kill=^U 46/* intr=^C quit=^\ erase=del kill=^U
45 eof=^D vtime=\0 vmin=\1 sxtc=\0 47 eof=^D vtime=\0 vmin=\1 sxtc=\0
46 start=^Q stop=^S susp=^Z eol=\0 48 start=^Q stop=^S susp=^Z eol=\0
@@ -58,39 +60,53 @@ struct termio {
58 *(unsigned short *) &(termios)->x = __tmp; \ 60 *(unsigned short *) &(termios)->x = __tmp; \
59} 61}
60 62
61#define user_termio_to_kernel_termios(termios, termio) \ 63static inline int user_termio_to_kernel_termios(struct ktermios *termios,
62({ \ 64 struct termio __user *termio)
63 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ 65{
64 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ 66 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag);
65 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ 67 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag);
66 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ 68 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag);
67 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ 69 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag);
68}) 70 return copy_from_user(termios->c_cc, termio->c_cc, NCC);
71}
69 72
70/* 73/*
71 * Translate a "termios" structure into a "termio". Ugh. 74 * Translate a "termios" structure into a "termio". Ugh.
72 */ 75 */
73#define kernel_termios_to_user_termio(termio, termios) \ 76static inline int kernel_termios_to_user_termio(struct termio __user *termio,
74({ \ 77 struct ktermios *termios)
75 put_user((termios)->c_iflag, &(termio)->c_iflag); \ 78{
76 put_user((termios)->c_oflag, &(termio)->c_oflag); \ 79 put_user((termios)->c_iflag, &(termio)->c_iflag);
77 put_user((termios)->c_cflag, &(termio)->c_cflag); \ 80 put_user((termios)->c_oflag, &(termio)->c_oflag);
78 put_user((termios)->c_lflag, &(termio)->c_lflag); \ 81 put_user((termios)->c_cflag, &(termio)->c_cflag);
79 put_user((termios)->c_line, &(termio)->c_line); \ 82 put_user((termios)->c_lflag, &(termio)->c_lflag);
80 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 83 put_user((termios)->c_line, &(termio)->c_line);
81}) 84 return copy_to_user((termio)->c_cc, (termios)->c_cc, NCC);
82 85}
83#define user_termios_to_kernel_termios(k, u) \ 86
84 copy_from_user(k, u, sizeof(struct termios2)) 87static inline int user_termios_to_kernel_termios(struct ktermios *k,
85 88 struct termios2 __user *u)
86#define kernel_termios_to_user_termios(u, k) \ 89{
87 copy_to_user(u, k, sizeof(struct termios2)) 90 return copy_from_user(k, u, sizeof(struct termios2));
88 91}
89#define user_termios_to_kernel_termios_1(k, u) \ 92
90 copy_from_user(k, u, sizeof(struct termios)) 93static inline int kernel_termios_to_user_termios(struct termios2 __user *u,
91 94 struct ktermios *k)
92#define kernel_termios_to_user_termios_1(u, k) \ 95{
93 copy_to_user(u, k, sizeof(struct termios)) 96 return copy_to_user(u, k, sizeof(struct termios2));
97}
98
99static inline int user_termios_to_kernel_termios_1(struct ktermios *k,
100 struct termios __user *u)
101{
102 return copy_from_user(k, u, sizeof(struct termios));
103}
104
105static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
106 struct ktermios *k)
107{
108 return copy_to_user(u, k, sizeof(struct termios));
109}
94 110
95#endif /* __KERNEL__ */ 111#endif /* __KERNEL__ */
96 112
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index 27cfd6c599ba..43e5a78500c5 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -14,7 +14,6 @@
14#endif 14#endif
15#define CLOCK_TICK_RATE PIT_TICK_RATE 15#define CLOCK_TICK_RATE PIT_TICK_RATE
16 16
17extern int read_current_timer(unsigned long *timer_value); 17#define ARCH_HAS_READ_CURRENT_TIMER
18#define ARCH_HAS_READ_CURRENT_TIMER 1
19 18
20#endif 19#endif
diff --git a/include/asm-x86/user.h b/include/asm-x86/user.h
index 484715abe74a..999873b22e7f 100644
--- a/include/asm-x86/user.h
+++ b/include/asm-x86/user.h
@@ -1,13 +1,5 @@
1#ifdef __KERNEL__ 1#ifdef CONFIG_X86_32
2# ifdef CONFIG_X86_32 2# include "user_32.h"
3# include "user_32.h"
4# else
5# include "user_64.h"
6# endif
7#else 3#else
8# ifdef __i386__ 4# include "user_64.h"
9# include "user_32.h"
10# else
11# include "user_64.h"
12# endif
13#endif 5#endif
diff --git a/include/asm-x86/user_32.h b/include/asm-x86/user_32.h
index ed8b8fc6906c..6157da6f882c 100644
--- a/include/asm-x86/user_32.h
+++ b/include/asm-x86/user_32.h
@@ -116,7 +116,7 @@ struct user{
116 esp register. */ 116 esp register. */
117 long int signal; /* Signal that caused the core dump. */ 117 long int signal; /* Signal that caused the core dump. */
118 int reserved; /* No longer used */ 118 int reserved; /* No longer used */
119 struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */ 119 unsigned long u_ar0; /* Used by gdb to help find the values for */
120 /* the registers. */ 120 /* the registers. */
121 struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */ 121 struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
122 unsigned long magic; /* To uniquely identify a core file */ 122 unsigned long magic; /* To uniquely identify a core file */
diff --git a/include/asm-x86/user_64.h b/include/asm-x86/user_64.h
index a5449d456cc0..963616455609 100644
--- a/include/asm-x86/user_64.h
+++ b/include/asm-x86/user_64.h
@@ -118,7 +118,7 @@ struct user{
118 long int signal; /* Signal that caused the core dump. */ 118 long int signal; /* Signal that caused the core dump. */
119 int reserved; /* No longer used */ 119 int reserved; /* No longer used */
120 int pad1; 120 int pad1;
121 struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */ 121 unsigned long u_ar0; /* Used by gdb to help find the values for */
122 /* the registers. */ 122 /* the registers. */
123 struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */ 123 struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
124 unsigned long magic; /* To uniquely identify a core file */ 124 unsigned long magic; /* To uniquely identify a core file */