aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/include')
-rw-r--r--arch/xtensa/include/asm/Kbuild1
-rw-r--r--arch/xtensa/include/asm/cacheflush.h2
-rw-r--r--arch/xtensa/include/asm/fixmap.h30
-rw-r--r--arch/xtensa/include/asm/highmem.h40
-rw-r--r--arch/xtensa/include/asm/page.h14
-rw-r--r--arch/xtensa/include/asm/pgtable.h7
-rw-r--r--arch/xtensa/include/asm/uaccess.h5
-rw-r--r--arch/xtensa/include/uapi/asm/ioctls.h21
-rw-r--r--arch/xtensa/include/uapi/asm/unistd.h5
9 files changed, 106 insertions, 19 deletions
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index c3d20ba6eb86..105d38922c44 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -12,6 +12,7 @@ generic-y += hardirq.h
12generic-y += hash.h 12generic-y += hash.h
13generic-y += ioctl.h 13generic-y += ioctl.h
14generic-y += irq_regs.h 14generic-y += irq_regs.h
15generic-y += irq_work.h
15generic-y += kdebug.h 16generic-y += kdebug.h
16generic-y += kmap_types.h 17generic-y += kmap_types.h
17generic-y += kvm_para.h 18generic-y += kvm_para.h
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h
index 555a98a18453..e72aaca7a77f 100644
--- a/arch/xtensa/include/asm/cacheflush.h
+++ b/arch/xtensa/include/asm/cacheflush.h
@@ -37,6 +37,7 @@
37 * specials for cache aliasing: 37 * specials for cache aliasing:
38 * 38 *
39 * __flush_invalidate_dcache_page_alias(vaddr,paddr) 39 * __flush_invalidate_dcache_page_alias(vaddr,paddr)
40 * __invalidate_dcache_page_alias(vaddr,paddr)
40 * __invalidate_icache_page_alias(vaddr,paddr) 41 * __invalidate_icache_page_alias(vaddr,paddr)
41 */ 42 */
42 43
@@ -62,6 +63,7 @@ extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
62 63
63#if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE) 64#if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE)
64extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long); 65extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long);
66extern void __invalidate_dcache_page_alias(unsigned long, unsigned long);
65#else 67#else
66static inline void __flush_invalidate_dcache_page_alias(unsigned long virt, 68static inline void __flush_invalidate_dcache_page_alias(unsigned long virt,
67 unsigned long phys) { } 69 unsigned long phys) { }
diff --git a/arch/xtensa/include/asm/fixmap.h b/arch/xtensa/include/asm/fixmap.h
index 9f6c33d0428a..62b507deea9d 100644
--- a/arch/xtensa/include/asm/fixmap.h
+++ b/arch/xtensa/include/asm/fixmap.h
@@ -23,8 +23,8 @@
23 * Here we define all the compile-time 'special' virtual 23 * Here we define all the compile-time 'special' virtual
24 * addresses. The point is to have a constant address at 24 * addresses. The point is to have a constant address at
25 * compile time, but to set the physical address only 25 * compile time, but to set the physical address only
26 * in the boot process. We allocate these special addresses 26 * in the boot process. We allocate these special addresses
27 * from the end of the consistent memory region backwards. 27 * from the start of the consistent memory region upwards.
28 * Also this lets us do fail-safe vmalloc(), we 28 * Also this lets us do fail-safe vmalloc(), we
29 * can guarantee that these special addresses and 29 * can guarantee that these special addresses and
30 * vmalloc()-ed addresses never overlap. 30 * vmalloc()-ed addresses never overlap.
@@ -38,7 +38,8 @@ enum fixed_addresses {
38#ifdef CONFIG_HIGHMEM 38#ifdef CONFIG_HIGHMEM
39 /* reserved pte's for temporary kernel mappings */ 39 /* reserved pte's for temporary kernel mappings */
40 FIX_KMAP_BEGIN, 40 FIX_KMAP_BEGIN,
41 FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, 41 FIX_KMAP_END = FIX_KMAP_BEGIN +
42 (KM_TYPE_NR * NR_CPUS * DCACHE_N_COLORS) - 1,
42#endif 43#endif
43 __end_of_fixed_addresses 44 __end_of_fixed_addresses
44}; 45};
@@ -47,7 +48,28 @@ enum fixed_addresses {
47#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 48#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
48#define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK) 49#define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK)
49 50
50#include <asm-generic/fixmap.h> 51#define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT))
52#define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT)
53
54#ifndef __ASSEMBLY__
55/*
56 * 'index to address' translation. If anyone tries to use the idx
57 * directly without translation, we catch the bug with a NULL-deference
58 * kernel oops. Illegal ranges of incoming indices are caught too.
59 */
60static __always_inline unsigned long fix_to_virt(const unsigned int idx)
61{
62 BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
63 return __fix_to_virt(idx);
64}
65
66static inline unsigned long virt_to_fix(const unsigned long vaddr)
67{
68 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
69 return __virt_to_fix(vaddr);
70}
71
72#endif
51 73
52#define kmap_get_fixmap_pte(vaddr) \ 74#define kmap_get_fixmap_pte(vaddr) \
53 pte_offset_kernel( \ 75 pte_offset_kernel( \
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h
index 2653ef5d55f1..2c7901edffaf 100644
--- a/arch/xtensa/include/asm/highmem.h
+++ b/arch/xtensa/include/asm/highmem.h
@@ -12,19 +12,55 @@
12#ifndef _XTENSA_HIGHMEM_H 12#ifndef _XTENSA_HIGHMEM_H
13#define _XTENSA_HIGHMEM_H 13#define _XTENSA_HIGHMEM_H
14 14
15#include <linux/wait.h>
15#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
16#include <asm/fixmap.h> 17#include <asm/fixmap.h>
17#include <asm/kmap_types.h> 18#include <asm/kmap_types.h>
18#include <asm/pgtable.h> 19#include <asm/pgtable.h>
19 20
20#define PKMAP_BASE (FIXADDR_START - PMD_SIZE) 21#define PKMAP_BASE ((FIXADDR_START - \
21#define LAST_PKMAP PTRS_PER_PTE 22 (LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK)
23#define LAST_PKMAP (PTRS_PER_PTE * DCACHE_N_COLORS)
22#define LAST_PKMAP_MASK (LAST_PKMAP - 1) 24#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
23#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) 25#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
24#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) 26#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
25 27
26#define kmap_prot PAGE_KERNEL 28#define kmap_prot PAGE_KERNEL
27 29
30#if DCACHE_WAY_SIZE > PAGE_SIZE
31#define get_pkmap_color get_pkmap_color
32static inline int get_pkmap_color(struct page *page)
33{
34 return DCACHE_ALIAS(page_to_phys(page));
35}
36
37extern unsigned int last_pkmap_nr_arr[];
38
39static inline unsigned int get_next_pkmap_nr(unsigned int color)
40{
41 last_pkmap_nr_arr[color] =
42 (last_pkmap_nr_arr[color] + DCACHE_N_COLORS) & LAST_PKMAP_MASK;
43 return last_pkmap_nr_arr[color] + color;
44}
45
46static inline int no_more_pkmaps(unsigned int pkmap_nr, unsigned int color)
47{
48 return pkmap_nr < DCACHE_N_COLORS;
49}
50
51static inline int get_pkmap_entries_count(unsigned int color)
52{
53 return LAST_PKMAP / DCACHE_N_COLORS;
54}
55
56extern wait_queue_head_t pkmap_map_wait_arr[];
57
58static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color)
59{
60 return pkmap_map_wait_arr + color;
61}
62#endif
63
28extern pte_t *pkmap_page_table; 64extern pte_t *pkmap_page_table;
29 65
30void *kmap_high(struct page *page); 66void *kmap_high(struct page *page);
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 47f582333f6b..abe24c6f8b2f 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -78,7 +78,9 @@
78# define DCACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & DCACHE_ALIAS_MASK) == 0) 78# define DCACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & DCACHE_ALIAS_MASK) == 0)
79#else 79#else
80# define DCACHE_ALIAS_ORDER 0 80# define DCACHE_ALIAS_ORDER 0
81# define DCACHE_ALIAS(a) ((void)(a), 0)
81#endif 82#endif
83#define DCACHE_N_COLORS (1 << DCACHE_ALIAS_ORDER)
82 84
83#if ICACHE_WAY_SIZE > PAGE_SIZE 85#if ICACHE_WAY_SIZE > PAGE_SIZE
84# define ICACHE_ALIAS_ORDER (ICACHE_WAY_SHIFT - PAGE_SHIFT) 86# define ICACHE_ALIAS_ORDER (ICACHE_WAY_SHIFT - PAGE_SHIFT)
@@ -134,6 +136,7 @@ static inline __attribute_const__ int get_order(unsigned long size)
134#endif 136#endif
135 137
136struct page; 138struct page;
139struct vm_area_struct;
137extern void clear_page(void *page); 140extern void clear_page(void *page);
138extern void copy_page(void *to, void *from); 141extern void copy_page(void *to, void *from);
139 142
@@ -143,8 +146,15 @@ extern void copy_page(void *to, void *from);
143 */ 146 */
144 147
145#if DCACHE_WAY_SIZE > PAGE_SIZE 148#if DCACHE_WAY_SIZE > PAGE_SIZE
146extern void clear_user_page(void*, unsigned long, struct page*); 149extern void clear_page_alias(void *vaddr, unsigned long paddr);
147extern void copy_user_page(void*, void*, unsigned long, struct page*); 150extern void copy_page_alias(void *to, void *from,
151 unsigned long to_paddr, unsigned long from_paddr);
152
153#define clear_user_highpage clear_user_highpage
154void clear_user_highpage(struct page *page, unsigned long vaddr);
155#define __HAVE_ARCH_COPY_USER_HIGHPAGE
156void copy_user_highpage(struct page *to, struct page *from,
157 unsigned long vaddr, struct vm_area_struct *vma);
148#else 158#else
149# define clear_user_page(page, vaddr, pg) clear_page(page) 159# define clear_user_page(page, vaddr, pg) clear_page(page)
150# define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 160# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h
index 4b0ca35a93b1..b2173e5da601 100644
--- a/arch/xtensa/include/asm/pgtable.h
+++ b/arch/xtensa/include/asm/pgtable.h
@@ -67,7 +67,12 @@
67#define VMALLOC_START 0xC0000000 67#define VMALLOC_START 0xC0000000
68#define VMALLOC_END 0xC7FEFFFF 68#define VMALLOC_END 0xC7FEFFFF
69#define TLBTEMP_BASE_1 0xC7FF0000 69#define TLBTEMP_BASE_1 0xC7FF0000
70#define TLBTEMP_BASE_2 0xC7FF8000 70#define TLBTEMP_BASE_2 (TLBTEMP_BASE_1 + DCACHE_WAY_SIZE)
71#if 2 * DCACHE_WAY_SIZE > ICACHE_WAY_SIZE
72#define TLBTEMP_SIZE (2 * DCACHE_WAY_SIZE)
73#else
74#define TLBTEMP_SIZE ICACHE_WAY_SIZE
75#endif
71 76
72/* 77/*
73 * For the Xtensa architecture, the PTE layout is as follows: 78 * For the Xtensa architecture, the PTE layout is as follows:
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
index fd686dc45d1a..c7211e7e182d 100644
--- a/arch/xtensa/include/asm/uaccess.h
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -52,7 +52,12 @@
52 */ 52 */
53 .macro get_fs ad, sp 53 .macro get_fs ad, sp
54 GET_CURRENT(\ad,\sp) 54 GET_CURRENT(\ad,\sp)
55#if THREAD_CURRENT_DS > 1020
56 addi \ad, \ad, TASK_THREAD
57 l32i \ad, \ad, THREAD_CURRENT_DS - TASK_THREAD
58#else
55 l32i \ad, \ad, THREAD_CURRENT_DS 59 l32i \ad, \ad, THREAD_CURRENT_DS
60#endif
56 .endm 61 .endm
57 62
58/* 63/*
diff --git a/arch/xtensa/include/uapi/asm/ioctls.h b/arch/xtensa/include/uapi/asm/ioctls.h
index b4cb1100c0fb..518954e74e6d 100644
--- a/arch/xtensa/include/uapi/asm/ioctls.h
+++ b/arch/xtensa/include/uapi/asm/ioctls.h
@@ -28,17 +28,17 @@
28#define TCSETSW 0x5403 28#define TCSETSW 0x5403
29#define TCSETSF 0x5404 29#define TCSETSF 0x5404
30 30
31#define TCGETA _IOR('t', 23, struct termio) 31#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
32#define TCSETA _IOW('t', 24, struct termio) 32#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
33#define TCSETAW _IOW('t', 25, struct termio) 33#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
34#define TCSETAF _IOW('t', 28, struct termio) 34#define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
35 35
36#define TCSBRK _IO('t', 29) 36#define TCSBRK _IO('t', 29)
37#define TCXONC _IO('t', 30) 37#define TCXONC _IO('t', 30)
38#define TCFLSH _IO('t', 31) 38#define TCFLSH _IO('t', 31)
39 39
40#define TIOCSWINSZ _IOW('t', 103, struct winsize) 40#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
41#define TIOCGWINSZ _IOR('t', 104, struct winsize) 41#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
42#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ 42#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
43#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ 43#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
44#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ 44#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
@@ -88,7 +88,6 @@
88#define TIOCSETD _IOW('T', 35, int) 88#define TIOCSETD _IOW('T', 35, int)
89#define TIOCGETD _IOR('T', 36, int) 89#define TIOCGETD _IOR('T', 36, int)
90#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/ 90#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
91#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
92#define TIOCSBRK _IO('T', 39) /* BSD compatibility */ 91#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
93#define TIOCCBRK _IO('T', 40) /* BSD compatibility */ 92#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
94#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/ 93#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
@@ -96,6 +95,8 @@
96#define TCSETS2 _IOW('T', 43, struct termios2) 95#define TCSETS2 _IOW('T', 43, struct termios2)
97#define TCSETSW2 _IOW('T', 44, struct termios2) 96#define TCSETSW2 _IOW('T', 44, struct termios2)
98#define TCSETSF2 _IOW('T', 45, struct termios2) 97#define TCSETSF2 _IOW('T', 45, struct termios2)
98#define TIOCGRS485 _IOR('T', 46, struct serial_rs485)
99#define TIOCSRS485 _IOWR('T', 47, struct serial_rs485)
99#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 100#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
100#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 101#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
101#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 102#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
@@ -114,8 +115,10 @@
114#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */ 115#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
115 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 116 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
116# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 117# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
117#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */ 118#define TIOCSERGETMULTI 0x80a8545a /* Get multiport config */
118#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ 119 /* _IOR('T', 90, struct serial_multiport_struct) */
120#define TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
121 /* _IOW('T', 91, struct serial_multiport_struct) */
119 122
120#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ 123#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
121#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ 124#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h
index b9395529f02d..8883fc877c5c 100644
--- a/arch/xtensa/include/uapi/asm/unistd.h
+++ b/arch/xtensa/include/uapi/asm/unistd.h
@@ -739,7 +739,10 @@ __SYSCALL(334, sys_sched_setattr, 2)
739#define __NR_sched_getattr 335 739#define __NR_sched_getattr 335
740__SYSCALL(335, sys_sched_getattr, 3) 740__SYSCALL(335, sys_sched_getattr, 3)
741 741
742#define __NR_syscall_count 336 742#define __NR_renameat2 336
743__SYSCALL(336, sys_renameat2, 5)
744
745#define __NR_syscall_count 337
743 746
744/* 747/*
745 * sysxtensa syscall handler 748 * sysxtensa syscall handler