aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/hexagon/include/asm/byteorder.h28
-rw-r--r--arch/hexagon/include/asm/elf.h229
-rw-r--r--arch/hexagon/include/asm/fpu.h4
-rw-r--r--arch/hexagon/include/asm/futex.h137
-rw-r--r--arch/hexagon/include/asm/linkage.h25
-rw-r--r--arch/hexagon/include/asm/module.h26
-rw-r--r--arch/hexagon/include/asm/param.h26
-rw-r--r--arch/hexagon/include/asm/perf_event.h24
-rw-r--r--arch/hexagon/include/asm/string.h32
-rw-r--r--arch/hexagon/include/asm/suspend.h27
-rw-r--r--arch/hexagon/include/asm/swab.h24
-rw-r--r--arch/hexagon/include/asm/timex.h36
12 files changed, 618 insertions, 0 deletions
diff --git a/arch/hexagon/include/asm/byteorder.h b/arch/hexagon/include/asm/byteorder.h
new file mode 100644
index 000000000000..0e19b9fe4ca6
--- /dev/null
+++ b/arch/hexagon/include/asm/byteorder.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_BYTEORDER_H
20#define _ASM_BYTEORDER_H
21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
23# define __BYTEORDER_HAS_U64__
24#endif
25
26#include <linux/byteorder/little_endian.h>
27
28#endif /* _ASM_BYTEORDER_H */
diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h
new file mode 100644
index 000000000000..37976a0d3650
--- /dev/null
+++ b/arch/hexagon/include/asm/elf.h
@@ -0,0 +1,229 @@
1/*
2 * ELF definitions for the Hexagon architecture
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef __ASM_ELF_H
22#define __ASM_ELF_H
23
24#include <asm/ptrace.h>
25#include <asm/user.h>
26
27/*
28 * This should really be in linux/elf-em.h.
29 */
30#define EM_HEXAGON 164 /* QUALCOMM Hexagon */
31
32struct elf32_hdr;
33
34/*
35 * ELF header e_flags defines.
36 */
37
38/* should have stuff like "CPU type" and maybe "ABI version", etc */
39
40/* Hexagon relocations */
41 /* V2 */
42#define R_HEXAGON_NONE 0
43#define R_HEXAGON_B22_PCREL 1
44#define R_HEXAGON_B15_PCREL 2
45#define R_HEXAGON_B7_PCREL 3
46#define R_HEXAGON_LO16 4
47#define R_HEXAGON_HI16 5
48#define R_HEXAGON_32 6
49#define R_HEXAGON_16 7
50#define R_HEXAGON_8 8
51#define R_HEXAGON_GPREL16_0 9
52#define R_HEXAGON_GPREL16_1 10
53#define R_HEXAGON_GPREL16_2 11
54#define R_HEXAGON_GPREL16_3 12
55#define R_HEXAGON_HL16 13
56 /* V3 */
57#define R_HEXAGON_B13_PCREL 14
58 /* V4 */
59#define R_HEXAGON_B9_PCREL 15
60 /* V4 (extenders) */
61#define R_HEXAGON_B32_PCREL_X 16
62#define R_HEXAGON_32_6_X 17
63 /* V4 (extended) */
64#define R_HEXAGON_B22_PCREL_X 18
65#define R_HEXAGON_B15_PCREL_X 19
66#define R_HEXAGON_B13_PCREL_X 20
67#define R_HEXAGON_B9_PCREL_X 21
68#define R_HEXAGON_B7_PCREL_X 22
69#define R_HEXAGON_16_X 23
70#define R_HEXAGON_12_X 24
71#define R_HEXAGON_11_X 25
72#define R_HEXAGON_10_X 26
73#define R_HEXAGON_9_X 27
74#define R_HEXAGON_8_X 28
75#define R_HEXAGON_7_X 29
76#define R_HEXAGON_6_X 30
77 /* V2 PIC */
78#define R_HEXAGON_32_PCREL 31
79#define R_HEXAGON_COPY 32
80#define R_HEXAGON_GLOB_DAT 33
81#define R_HEXAGON_JMP_SLOT 34
82#define R_HEXAGON_RELATIVE 35
83#define R_HEXAGON_PLT_B22_PCREL 36
84#define R_HEXAGON_GOTOFF_LO16 37
85#define R_HEXAGON_GOTOFF_HI16 38
86#define R_HEXAGON_GOTOFF_32 39
87#define R_HEXAGON_GOT_LO16 40
88#define R_HEXAGON_GOT_HI16 41
89#define R_HEXAGON_GOT_32 42
90#define R_HEXAGON_GOT_16 43
91
92/*
93 * ELF register definitions..
94 */
95typedef unsigned long elf_greg_t;
96
97typedef struct user_regs_struct elf_gregset_t;
98#define ELF_NGREG (sizeof(elf_gregset_t)/sizeof(unsigned long))
99
100/* Placeholder */
101typedef unsigned long elf_fpregset_t;
102
103/*
104 * Bypass the whole "regsets" thing for now and use the define.
105 */
106
107#define ELF_CORE_COPY_REGS(DEST, REGS) \
108do { \
109 DEST.r0 = REGS->r00; \
110 DEST.r1 = REGS->r01; \
111 DEST.r2 = REGS->r02; \
112 DEST.r3 = REGS->r03; \
113 DEST.r4 = REGS->r04; \
114 DEST.r5 = REGS->r05; \
115 DEST.r6 = REGS->r06; \
116 DEST.r7 = REGS->r07; \
117 DEST.r8 = REGS->r08; \
118 DEST.r9 = REGS->r09; \
119 DEST.r10 = REGS->r10; \
120 DEST.r11 = REGS->r11; \
121 DEST.r12 = REGS->r12; \
122 DEST.r13 = REGS->r13; \
123 DEST.r14 = REGS->r14; \
124 DEST.r15 = REGS->r15; \
125 DEST.r16 = REGS->r16; \
126 DEST.r17 = REGS->r17; \
127 DEST.r18 = REGS->r18; \
128 DEST.r19 = REGS->r19; \
129 DEST.r20 = REGS->r20; \
130 DEST.r21 = REGS->r21; \
131 DEST.r22 = REGS->r22; \
132 DEST.r23 = REGS->r23; \
133 DEST.r24 = REGS->r24; \
134 DEST.r25 = REGS->r25; \
135 DEST.r26 = REGS->r26; \
136 DEST.r27 = REGS->r27; \
137 DEST.r28 = REGS->r28; \
138 DEST.r29 = pt_psp(REGS); \
139 DEST.r30 = REGS->r30; \
140 DEST.r31 = REGS->r31; \
141 DEST.sa0 = REGS->sa0; \
142 DEST.lc0 = REGS->lc0; \
143 DEST.sa1 = REGS->sa1; \
144 DEST.lc1 = REGS->lc1; \
145 DEST.m0 = REGS->m0; \
146 DEST.m1 = REGS->m1; \
147 DEST.usr = REGS->usr; \
148 DEST.p3_0 = REGS->preds; \
149 DEST.gp = REGS->gp; \
150 DEST.ugp = REGS->ugp; \
151 DEST.pc = pt_elr(REGS); \
152 DEST.cause = pt_cause(REGS); \
153 DEST.badva = pt_badva(REGS); \
154} while (0);
155
156
157
158/*
159 * This is used to ensure we don't load something for the wrong architecture.
160 * Checks the machine and ABI type.
161 */
162#define elf_check_arch(hdr) ((hdr)->e_machine == EM_HEXAGON)
163
164/*
165 * These are used to set parameters in the core dumps.
166 */
167#define ELF_CLASS ELFCLASS32
168#define ELF_DATA ELFDATA2LSB
169#define ELF_ARCH EM_HEXAGON
170
171#ifdef CONFIG_HEXAGON_ARCH_V2
172#define ELF_CORE_EFLAGS 0x1
173#endif
174
175#ifdef CONFIG_HEXAGON_ARCH_V3
176#define ELF_CORE_EFLAGS 0x2
177#endif
178
179#ifdef CONFIG_HEXAGON_ARCH_V4
180#define ELF_CORE_EFLAGS 0x3
181#endif
182
183/*
184 * Some architectures have ld.so set up a pointer to a function
185 * to be registered using atexit, to facilitate cleanup. So that
186 * static executables will be well-behaved, we would null the register
187 * in question here, in the pt_regs structure passed. For now,
188 * leave it a null macro.
189 */
190#define ELF_PLAT_INIT(regs, load_addr) do { } while (0)
191
192#define USE_ELF_CORE_DUMP
193#define CORE_DUMP_USE_REGSET
194
195/* Hrm is this going to cause problems for changing PAGE_SIZE? */
196#define ELF_EXEC_PAGESIZE 4096
197
198/*
199 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
200 * use of this is to invoke "./ld.so someprog" to test out a new version of
201 * the loader. We need to make sure that it is out of the way of the program
202 * that it will "exec", and that there is sufficient room for the brk.
203 */
204#define ELF_ET_DYN_BASE 0x08000000UL
205
206/*
207 * This yields a mask that user programs can use to figure out what
208 * instruction set this cpu supports.
209 */
210#define ELF_HWCAP (0)
211
212/*
213 * This yields a string that ld.so will use to load implementation
214 * specific libraries for optimization. This is more specific in
215 * intent than poking at uname or /proc/cpuinfo.
216 */
217#define ELF_PLATFORM (NULL)
218
219#ifdef __KERNEL__
220#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
221#endif
222
223#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
224struct linux_binprm;
225extern int arch_setup_additional_pages(struct linux_binprm *bprm,
226 int uses_interp);
227
228
229#endif
diff --git a/arch/hexagon/include/asm/fpu.h b/arch/hexagon/include/asm/fpu.h
new file mode 100644
index 000000000000..0e135ea8c45b
--- /dev/null
+++ b/arch/hexagon/include/asm/fpu.h
@@ -0,0 +1,4 @@
1/*
2 * If the FPU is used inside the kernel,
3 * kernel_fpu_end() will be defined here.
4 */
diff --git a/arch/hexagon/include/asm/futex.h b/arch/hexagon/include/asm/futex.h
new file mode 100644
index 000000000000..7e597f8434da
--- /dev/null
+++ b/arch/hexagon/include/asm/futex.h
@@ -0,0 +1,137 @@
1#ifndef _ASM_HEXAGON_FUTEX_H
2#define _ASM_HEXAGON_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <linux/uaccess.h>
8#include <asm/errno.h>
9
10/* XXX TODO-- need to add sync barriers! */
11
12#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
13 __asm__ __volatile( \
14 "1: %0 = memw_locked(%3);\n" \
15 /* For example: %1 = %4 */ \
16 insn \
17 "2: memw_locked(%3,p2) = %1;\n" \
18 " if !p2 jump 1b;\n" \
19 " %1 = #0;\n" \
20 "3:\n" \
21 ".section .fixup,\"ax\"\n" \
22 "4: %1 = #%5;\n" \
23 " jump 3b\n" \
24 ".previous\n" \
25 ".section __ex_table,\"a\"\n" \
26 ".long 1b,4b,2b,4b\n" \
27 ".previous\n" \
28 : "=&r" (oldval), "=&r" (ret), "+m" (*uaddr) \
29 : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \
30 : "p2", "memory")
31
32
33static inline int
34futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
35{
36 int op = (encoded_op >> 28) & 7;
37 int cmp = (encoded_op >> 24) & 15;
38 int oparg = (encoded_op << 8) >> 20;
39 int cmparg = (encoded_op << 20) >> 20;
40 int oldval = 0, ret;
41 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
42 oparg = 1 << oparg;
43
44 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
45 return -EFAULT;
46
47 pagefault_disable();
48
49 switch (op) {
50 case FUTEX_OP_SET:
51 __futex_atomic_op("%1 = %4\n", ret, oldval, uaddr, oparg);
52 break;
53 case FUTEX_OP_ADD:
54 __futex_atomic_op("%1 = add(%0,%4)\n", ret, oldval, uaddr,
55 oparg);
56 break;
57 case FUTEX_OP_OR:
58 __futex_atomic_op("%1 = or(%0,%4)\n", ret, oldval, uaddr,
59 oparg);
60 break;
61 case FUTEX_OP_ANDN:
62 __futex_atomic_op("%1 = not(%4); %1 = and(%0,%1)\n", ret,
63 oldval, uaddr, oparg);
64 break;
65 case FUTEX_OP_XOR:
66 __futex_atomic_op("%1 = xor(%0,%4)\n", ret, oldval, uaddr,
67 oparg);
68 break;
69 default:
70 ret = -ENOSYS;
71 }
72
73 pagefault_enable();
74
75 if (!ret) {
76 switch (cmp) {
77 case FUTEX_OP_CMP_EQ:
78 ret = (oldval == cmparg);
79 break;
80 case FUTEX_OP_CMP_NE:
81 ret = (oldval != cmparg);
82 break;
83 case FUTEX_OP_CMP_LT:
84 ret = (oldval < cmparg);
85 break;
86 case FUTEX_OP_CMP_GE:
87 ret = (oldval >= cmparg);
88 break;
89 case FUTEX_OP_CMP_LE:
90 ret = (oldval <= cmparg);
91 break;
92 case FUTEX_OP_CMP_GT:
93 ret = (oldval > cmparg);
94 break;
95 default:
96 ret = -ENOSYS;
97 }
98 }
99 return ret;
100}
101
102static inline int
103futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval,
104 u32 newval)
105{
106 int prev;
107 int ret;
108
109 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
110 return -EFAULT;
111
112 __asm__ __volatile__ (
113 "1: %1 = memw_locked(%3)\n"
114 " {\n"
115 " p2 = cmp.eq(%1,%4)\n"
116 " if !p2.new jump:NT 3f\n"
117 " }\n"
118 "2: memw_locked(%3,p2) = %5\n"
119 " if !p2 jump 1b\n"
120 "3:\n"
121 ".section .fixup,\"ax\"\n"
122 "4: %0 = #%6\n"
123 " jump 3b\n"
124 ".previous\n"
125 ".section __ex_table,\"a\"\n"
126 ".long 1b,4b,2b,4b\n"
127 ".previous\n"
128 : "+r" (ret), "=&r" (prev), "+m" (*uaddr)
129 : "r" (uaddr), "r" (oldval), "r" (newval), "i"(-EFAULT)
130 : "p2", "memory");
131
132 *uval = prev;
133 return ret;
134}
135
136#endif /* __KERNEL__ */
137#endif /* _ASM_HEXAGON_FUTEX_H */
diff --git a/arch/hexagon/include/asm/linkage.h b/arch/hexagon/include/asm/linkage.h
new file mode 100644
index 000000000000..a00b85f680b8
--- /dev/null
+++ b/arch/hexagon/include/asm/linkage.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef __ASM_LINKAGE_H
20#define __ASM_LINKAGE_H
21
22#define __ALIGN .align 4
23#define __ALIGN_STR ".align 4"
24
25#endif
diff --git a/arch/hexagon/include/asm/module.h b/arch/hexagon/include/asm/module.h
new file mode 100644
index 000000000000..72ba494e6d7d
--- /dev/null
+++ b/arch/hexagon/include/asm/module.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_MODULE_H
20#define _ASM_MODULE_H
21
22#include <asm-generic/module.h>
23
24#define MODULE_ARCH_VERMAGIC __stringify(PROCESSOR_MODEL_NAME) " "
25
26#endif
diff --git a/arch/hexagon/include/asm/param.h b/arch/hexagon/include/asm/param.h
new file mode 100644
index 000000000000..285344bbd036
--- /dev/null
+++ b/arch/hexagon/include/asm/param.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_PARAM_H
20#define _ASM_PARAM_H
21
22#define EXEC_PAGESIZE 16384
23
24#include <asm-generic/param.h>
25
26#endif
diff --git a/arch/hexagon/include/asm/perf_event.h b/arch/hexagon/include/asm/perf_event.h
new file mode 100644
index 000000000000..6c2910f91180
--- /dev/null
+++ b/arch/hexagon/include/asm/perf_event.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_PERF_EVENT_H
20#define _ASM_PERF_EVENT_H
21
22#define PERF_EVENT_INDEX_OFFSET 0
23
24#endif /* _ASM_PERF_EVENT_H */
diff --git a/arch/hexagon/include/asm/string.h b/arch/hexagon/include/asm/string.h
new file mode 100644
index 000000000000..f4489c15942c
--- /dev/null
+++ b/arch/hexagon/include/asm/string.h
@@ -0,0 +1,32 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_STRING_H_
20#define _ASM_STRING_H_
21
22#ifdef __KERNEL__
23#define __HAVE_ARCH_MEMCPY
24extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
25
26/* ToDo: use dczeroa, accelerate the compiler-constant zero case */
27#define __HAVE_ARCH_MEMSET
28extern void *memset(void *__to, int c, size_t __n);
29#endif
30
31
32#endif /* _ASM_STRING_H_ */
diff --git a/arch/hexagon/include/asm/suspend.h b/arch/hexagon/include/asm/suspend.h
new file mode 100644
index 000000000000..089dd8268791
--- /dev/null
+++ b/arch/hexagon/include/asm/suspend.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_SUSPEND_H
20#define _ASM_SUSPEND_H
21
22static inline int arch_prepare_suspend(void)
23{
24 return 0;
25}
26
27#endif
diff --git a/arch/hexagon/include/asm/swab.h b/arch/hexagon/include/asm/swab.h
new file mode 100644
index 000000000000..99cf0be3fb83
--- /dev/null
+++ b/arch/hexagon/include/asm/swab.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_SWAB_H
20#define _ASM_SWAB_H
21
22#define __SWAB_64_THRU_32__
23
24#endif
diff --git a/arch/hexagon/include/asm/timex.h b/arch/hexagon/include/asm/timex.h
new file mode 100644
index 000000000000..b11c62b23f31
--- /dev/null
+++ b/arch/hexagon/include/asm/timex.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_TIMEX_H
20#define _ASM_TIMEX_H
21
22#include <asm-generic/timex.h>
23#include <asm/timer-regs.h>
24
25/* Using TCX0 as our clock. CLOCK_TICK_RATE scheduled to be removed. */
26#define CLOCK_TICK_RATE TCX0_CLK_RATE
27
28#define ARCH_HAS_READ_CURRENT_TIMER
29
30static inline int read_current_timer(unsigned long *timer_val)
31{
32 *timer_val = (unsigned long) __vmgettime();
33 return 0;
34}
35
36#endif