aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
committerLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
commit64e47488c913ac704d465a6af86a26786d1412a5 (patch)
treed3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /include/asm-x86_64
parent4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff)
parentcaf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff)
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r--include/asm-x86_64/auxvec.h4
-rw-r--r--include/asm-x86_64/compat.h20
-rw-r--r--include/asm-x86_64/fcntl.h77
-rw-r--r--include/asm-x86_64/futex.h98
-rw-r--r--include/asm-x86_64/hdreg.h1
-rw-r--r--include/asm-x86_64/page.h17
-rw-r--r--include/asm-x86_64/pgtable.h19
-rw-r--r--include/asm-x86_64/processor.h7
-rw-r--r--include/asm-x86_64/types.h2
-rw-r--r--include/asm-x86_64/uaccess.h7
10 files changed, 138 insertions, 114 deletions
diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86_64/auxvec.h
new file mode 100644
index 000000000000..2403c4cfced2
--- /dev/null
+++ b/include/asm-x86_64/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_X86_64_AUXVEC_H
2#define __ASM_X86_64_AUXVEC_H
3
4#endif
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index d0f453c5adfc..f0155c38f639 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -14,10 +14,10 @@ typedef s32 compat_ssize_t;
14typedef s32 compat_time_t; 14typedef s32 compat_time_t;
15typedef s32 compat_clock_t; 15typedef s32 compat_clock_t;
16typedef s32 compat_pid_t; 16typedef s32 compat_pid_t;
17typedef u16 compat_uid_t; 17typedef u16 __compat_uid_t;
18typedef u16 compat_gid_t; 18typedef u16 __compat_gid_t;
19typedef u32 compat_uid32_t; 19typedef u32 __compat_uid32_t;
20typedef u32 compat_gid32_t; 20typedef u32 __compat_gid32_t;
21typedef u16 compat_mode_t; 21typedef u16 compat_mode_t;
22typedef u32 compat_ino_t; 22typedef u32 compat_ino_t;
23typedef u16 compat_dev_t; 23typedef u16 compat_dev_t;
@@ -52,8 +52,8 @@ struct compat_stat {
52 compat_ino_t st_ino; 52 compat_ino_t st_ino;
53 compat_mode_t st_mode; 53 compat_mode_t st_mode;
54 compat_nlink_t st_nlink; 54 compat_nlink_t st_nlink;
55 compat_uid_t st_uid; 55 __compat_uid_t st_uid;
56 compat_gid_t st_gid; 56 __compat_gid_t st_gid;
57 compat_dev_t st_rdev; 57 compat_dev_t st_rdev;
58 u16 __pad2; 58 u16 __pad2;
59 u32 st_size; 59 u32 st_size;
@@ -122,10 +122,10 @@ typedef u32 compat_sigset_word;
122 122
123struct compat_ipc64_perm { 123struct compat_ipc64_perm {
124 compat_key_t key; 124 compat_key_t key;
125 compat_uid32_t uid; 125 __compat_uid32_t uid;
126 compat_gid32_t gid; 126 __compat_gid32_t gid;
127 compat_uid32_t cuid; 127 __compat_uid32_t cuid;
128 compat_gid32_t cgid; 128 __compat_gid32_t cgid;
129 unsigned short mode; 129 unsigned short mode;
130 unsigned short __pad1; 130 unsigned short __pad1;
131 unsigned short seq; 131 unsigned short seq;
diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h
index 4411f221c037..46ab12db5739 100644
--- a/include/asm-x86_64/fcntl.h
+++ b/include/asm-x86_64/fcntl.h
@@ -1,76 +1 @@
1#ifndef _X86_64_FCNTL_H #include <asm-generic/fcntl.h>
2#define _X86_64_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECT 040000 /* direct disk access hint */
20#define O_LARGEFILE 0100000
21#define O_DIRECTORY 0200000 /* must be a directory */
22#define O_NOFOLLOW 0400000 /* don't follow links */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39/* for F_[GET|SET]FL */
40#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
41
42/* for posix fcntl() and lockf() */
43#define F_RDLCK 0
44#define F_WRLCK 1
45#define F_UNLCK 2
46
47/* for old implementation of bsd flock () */
48#define F_EXLCK 4 /* or 3 */
49#define F_SHLCK 8 /* or 4 */
50
51/* for leases */
52#define F_INPROGRESS 16
53
54/* operations for bsd flock(), also used by the kernel implementation */
55#define LOCK_SH 1 /* shared lock */
56#define LOCK_EX 2 /* exclusive lock */
57#define LOCK_NB 4 /* or'd with one of the above to prevent
58 blocking */
59#define LOCK_UN 8 /* remove lock */
60
61#define LOCK_MAND 32 /* This is a mandatory flock */
62#define LOCK_READ 64 /* ... Which allows concurrent read operations */
63#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
64#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
65
66struct flock {
67 short l_type;
68 short l_whence;
69 off_t l_start;
70 off_t l_len;
71 pid_t l_pid;
72};
73
74#define F_LINUX_SPECIFIC_BASE 1024
75
76#endif /* !_X86_64_FCNTL_H */
diff --git a/include/asm-x86_64/futex.h b/include/asm-x86_64/futex.h
new file mode 100644
index 000000000000..8602c09bf89e
--- /dev/null
+++ b/include/asm-x86_64/futex.h
@@ -0,0 +1,98 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/system.h>
9#include <asm/uaccess.h>
10
11#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
12 __asm__ __volatile ( \
13"1: " insn "\n" \
14"2: .section .fixup,\"ax\"\n\
153: mov %3, %1\n\
16 jmp 2b\n\
17 .previous\n\
18 .section __ex_table,\"a\"\n\
19 .align 8\n\
20 .quad 1b,3b\n\
21 .previous" \
22 : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \
23 : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0))
24
25#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
26 __asm__ __volatile ( \
27"1: movl %2, %0\n\
28 movl %0, %3\n" \
29 insn "\n" \
30"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
31 jnz 1b\n\
323: .section .fixup,\"ax\"\n\
334: mov %5, %1\n\
34 jmp 3b\n\
35 .previous\n\
36 .section __ex_table,\"a\"\n\
37 .align 8\n\
38 .quad 1b,4b,2b,4b\n\
39 .previous" \
40 : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \
41 "=&r" (tem) \
42 : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0))
43
44static inline int
45futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
46{
47 int op = (encoded_op >> 28) & 7;
48 int cmp = (encoded_op >> 24) & 15;
49 int oparg = (encoded_op << 8) >> 20;
50 int cmparg = (encoded_op << 20) >> 20;
51 int oldval = 0, ret, tem;
52 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
53 oparg = 1 << oparg;
54
55 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
56 return -EFAULT;
57
58 inc_preempt_count();
59
60 switch (op) {
61 case FUTEX_OP_SET:
62 __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
63 break;
64 case FUTEX_OP_ADD:
65 __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
66 uaddr, oparg);
67 break;
68 case FUTEX_OP_OR:
69 __futex_atomic_op2("orl %4, %3", ret, oldval, uaddr, oparg);
70 break;
71 case FUTEX_OP_ANDN:
72 __futex_atomic_op2("andl %4, %3", ret, oldval, uaddr, ~oparg);
73 break;
74 case FUTEX_OP_XOR:
75 __futex_atomic_op2("xorl %4, %3", ret, oldval, uaddr, oparg);
76 break;
77 default:
78 ret = -ENOSYS;
79 }
80
81 dec_preempt_count();
82
83 if (!ret) {
84 switch (cmp) {
85 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
86 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
87 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
88 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
89 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
90 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
91 default: ret = -ENOSYS;
92 }
93 }
94 return ret;
95}
96
97#endif
98#endif
diff --git a/include/asm-x86_64/hdreg.h b/include/asm-x86_64/hdreg.h
deleted file mode 100644
index 5989bbc97cbf..000000000000
--- a/include/asm-x86_64/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#warning this file is obsolete, please do not use it
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 431318764af6..135ffaa0393b 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -28,7 +28,6 @@
28#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) 28#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
29#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 29#define HPAGE_MASK (~(HPAGE_SIZE - 1))
30#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) 30#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
31#define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
32 31
33#ifdef __KERNEL__ 32#ifdef __KERNEL__
34#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
@@ -92,20 +91,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
92 91
93#include <asm/bug.h> 92#include <asm/bug.h>
94 93
95/* Pure 2^n version of get_order */
96extern __inline__ int get_order(unsigned long size)
97{
98 int order;
99
100 size = (size-1) >> (PAGE_SHIFT-1);
101 order = -1;
102 do {
103 size >>= 1;
104 order++;
105 } while (size);
106 return order;
107}
108
109#endif /* __ASSEMBLY__ */ 94#endif /* __ASSEMBLY__ */
110 95
111#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 96#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
@@ -141,4 +126,6 @@ extern __inline__ int get_order(unsigned long size)
141 126
142#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
143 128
129#include <asm-generic/page.h>
130
144#endif /* _X86_64_PAGE_H */ 131#endif /* _X86_64_PAGE_H */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 4e167b5ea8f3..5e0f2fdab0d3 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -104,6 +104,19 @@ extern inline void pgd_clear (pgd_t * pgd)
104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK)) 104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
105 105
106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) 106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0))
107
108static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
109{
110 pte_t pte;
111 if (full) {
112 pte = *ptep;
113 *ptep = __pte(0);
114 } else {
115 pte = ptep_get_and_clear(mm, addr, ptep);
116 }
117 return pte;
118}
119
107#define pte_same(a, b) ((a).pte == (b).pte) 120#define pte_same(a, b) ((a).pte == (b).pte)
108 121
109#define PMD_SIZE (1UL << PMD_SHIFT) 122#define PMD_SIZE (1UL << PMD_SHIFT)
@@ -143,7 +156,7 @@ extern inline void pgd_clear (pgd_t * pgd)
143#define _PAGE_ACCESSED 0x020 156#define _PAGE_ACCESSED 0x020
144#define _PAGE_DIRTY 0x040 157#define _PAGE_DIRTY 0x040
145#define _PAGE_PSE 0x080 /* 2MB page */ 158#define _PAGE_PSE 0x080 /* 2MB page */
146#define _PAGE_FILE 0x040 /* set:pagecache, unset:swap */ 159#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
147#define _PAGE_GLOBAL 0x100 /* Global TLB entry */ 160#define _PAGE_GLOBAL 0x100 /* Global TLB entry */
148 161
149#define _PAGE_PROTNONE 0x080 /* If not present */ 162#define _PAGE_PROTNONE 0x080 /* If not present */
@@ -247,6 +260,7 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
247 * The following only work if pte_present() is true. 260 * The following only work if pte_present() is true.
248 * Undefined behaviour if not.. 261 * Undefined behaviour if not..
249 */ 262 */
263#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
250static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 264static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
251extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 265extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
252extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 266extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
@@ -254,8 +268,8 @@ extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
254extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 268extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
255extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 269extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
256static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 270static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
271static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; }
257 272
258#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
259extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } 273extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
260extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } 274extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
261extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } 275extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
@@ -433,6 +447,7 @@ extern int kern_addr_valid(unsigned long addr);
433#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 447#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
434#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 448#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
435#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 449#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
450#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
436#define __HAVE_ARCH_PTEP_SET_WRPROTECT 451#define __HAVE_ARCH_PTEP_SET_WRPROTECT
437#define __HAVE_ARCH_PTE_SAME 452#define __HAVE_ARCH_PTE_SAME
438#include <asm-generic/pgtable.h> 453#include <asm-generic/pgtable.h>
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 85549e656eeb..a8321999448f 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -398,7 +398,7 @@ static inline void prefetch(void *x)
398#define ARCH_HAS_PREFETCHW 1 398#define ARCH_HAS_PREFETCHW 1
399static inline void prefetchw(void *x) 399static inline void prefetchw(void *x)
400{ 400{
401 alternative_input(ASM_NOP5, 401 alternative_input("prefetcht0 (%1)",
402 "prefetchw (%1)", 402 "prefetchw (%1)",
403 X86_FEATURE_3DNOW, 403 X86_FEATURE_3DNOW,
404 "r" (x)); 404 "r" (x));
@@ -437,6 +437,11 @@ static inline void prefetchw(void *x)
437 outb((data), 0x23); \ 437 outb((data), 0x23); \
438} while (0) 438} while (0)
439 439
440static inline void serialize_cpu(void)
441{
442 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
443}
444
440static inline void __monitor(const void *eax, unsigned long ecx, 445static inline void __monitor(const void *eax, unsigned long ecx,
441 unsigned long edx) 446 unsigned long edx)
442{ 447{
diff --git a/include/asm-x86_64/types.h b/include/asm-x86_64/types.h
index 32bd1426b523..c86c2e6793e2 100644
--- a/include/asm-x86_64/types.h
+++ b/include/asm-x86_64/types.h
@@ -51,8 +51,6 @@ typedef u64 dma_addr_t;
51typedef u64 sector_t; 51typedef u64 sector_t;
52#define HAVE_SECTOR_T 52#define HAVE_SECTOR_T
53 53
54typedef unsigned short kmem_bufctl_t;
55
56#endif /* __ASSEMBLY__ */ 54#endif /* __ASSEMBLY__ */
57 55
58#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 48f292752c96..1bb8b8a24436 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -49,13 +49,6 @@
49 49
50#define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0) 50#define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0)
51 51
52/* this function will go away soon - use access_ok() instead */
53extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
54{
55 return access_ok(type,addr,size) ? 0 : -EFAULT;
56}
57
58
59/* 52/*
60 * The exception table consists of pairs of addresses: the first is the 53 * The exception table consists of pairs of addresses: the first is the
61 * address of an instruction that is allowed to fault, and the second is 54 * address of an instruction that is allowed to fault, and the second is