entry-common.S (4a7126a25b4dfd07d61c699f724118275acc0c25) entry-common.S (96a8fae0fe094b6a26a3ec88b2f097418f269cfe)
1/*
2 * linux/arch/arm/kernel/entry-common.S
3 *
4 * Copyright (C) 2000 Russell King
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 as
8 * published by the Free Software Foundation.
9 */
10
11#include <asm/assembler.h>
12#include <asm/unistd.h>
13#include <asm/ftrace.h>
14#include <asm/unwind.h>
1/*
2 * linux/arch/arm/kernel/entry-common.S
3 *
4 * Copyright (C) 2000 Russell King
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 as
8 * published by the Free Software Foundation.
9 */
10
11#include <asm/assembler.h>
12#include <asm/unistd.h>
13#include <asm/ftrace.h>
14#include <asm/unwind.h>
15#ifdef CONFIG_AEABI
16#include <asm/unistd-oabi.h>
17#endif
15
18
19 .equ NR_syscalls, __NR_syscalls
20
16#ifdef CONFIG_NEED_RET_TO_USER
17#include <mach/entry-macro.S>
18#else
19 .macro arch_ret_to_user, tmp1, tmp2
20 .endm
21#endif
22
23#include "entry-header.S"

--- 91 unchanged lines hidden (view full) ---

115 cmp r5, #0
116 movne r0, r4
117 badrne lr, 1f
118 retne r5
1191: get_thread_info tsk
120 b ret_slow_syscall
121ENDPROC(ret_from_fork)
122
21#ifdef CONFIG_NEED_RET_TO_USER
22#include <mach/entry-macro.S>
23#else
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26#endif
27
28#include "entry-header.S"

--- 91 unchanged lines hidden (view full) ---

120 cmp r5, #0
121 movne r0, r4
122 badrne lr, 1f
123 retne r5
1241: get_thread_info tsk
125 b ret_slow_syscall
126ENDPROC(ret_from_fork)
127
123 .equ NR_syscalls,0
124#define CALL(x) .equ NR_syscalls,NR_syscalls+1
125#include "calls.S"
126
127/*
128 * Ensure that the system call table is equal to __NR_syscalls,
129 * which is the value the rest of the system sees
130 */
131.ifne NR_syscalls - __NR_syscalls
132.error "__NR_syscalls is not equal to the size of the syscall table"
133.endif
134
135#undef CALL
136#define CALL(x) .long x
137
138/*=============================================================================
139 * SWI handler
140 *-----------------------------------------------------------------------------
141 */
142
143 .align 5
144ENTRY(vector_swi)
145#ifdef CONFIG_CPU_V7M

--- 140 unchanged lines hidden (view full) ---

286 .align 5
287#ifdef CONFIG_ALIGNMENT_TRAP
288 .type __cr_alignment, #object
289__cr_alignment:
290 .word cr_alignment
291#endif
292 .ltorg
293
128/*=============================================================================
129 * SWI handler
130 *-----------------------------------------------------------------------------
131 */
132
133 .align 5
134ENTRY(vector_swi)
135#ifdef CONFIG_CPU_V7M

--- 140 unchanged lines hidden (view full) ---

276 .align 5
277#ifdef CONFIG_ALIGNMENT_TRAP
278 .type __cr_alignment, #object
279__cr_alignment:
280 .word cr_alignment
281#endif
282 .ltorg
283
284 .macro syscall_table_start, sym
285 .equ __sys_nr, 0
286 .type \sym, #object
287ENTRY(\sym)
288 .endm
289
290 .macro syscall, nr, func
291 .ifgt __sys_nr - \nr
292 .error "Duplicated/unorded system call entry"
293 .endif
294 .rept \nr - __sys_nr
295 .long sys_ni_syscall
296 .endr
297 .long \func
298 .equ __sys_nr, \nr + 1
299 .endm
300
301 .macro syscall_table_end, sym
302 .ifgt __sys_nr - __NR_syscalls
303 .error "System call table too big"
304 .endif
305 .rept __NR_syscalls - __sys_nr
306 .long sys_ni_syscall
307 .endr
308 .size \sym, . - \sym
309 .endm
310
311#define NATIVE(nr, func) syscall nr, func
312
294/*
295 * This is the syscall table declaration for native ABI syscalls.
296 * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.
297 */
313/*
314 * This is the syscall table declaration for native ABI syscalls.
315 * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.
316 */
298#define ABI(native, compat) native
317 syscall_table_start sys_call_table
318#define COMPAT(nr, native, compat) syscall nr, native
299#ifdef CONFIG_AEABI
319#ifdef CONFIG_AEABI
300#define OBSOLETE(syscall) sys_ni_syscall
320#include <calls-eabi.S>
301#else
321#else
302#define OBSOLETE(syscall) syscall
322#include <calls-oabi.S>
303#endif
323#endif
324#undef COMPAT
325 syscall_table_end sys_call_table
304
326
305 .type sys_call_table, #object
306ENTRY(sys_call_table)
307#include "calls.S"
308#undef ABI
309#undef OBSOLETE
310
311/*============================================================================
312 * Special system call wrappers
313 */
314@ r0 = syscall number
315@ r8 = syscall table
316sys_syscall:
317 bic scno, r0, #__NR_OABI_SYSCALL_BASE
318 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE

--- 83 unchanged lines hidden (view full) ---

402 mov r2, r1
403 b sys_readahead
404ENDPROC(sys_oabi_readahead)
405
406/*
407 * Let's declare a second syscall table for old ABI binaries
408 * using the compatibility syscall entries.
409 */
327/*============================================================================
328 * Special system call wrappers
329 */
330@ r0 = syscall number
331@ r8 = syscall table
332sys_syscall:
333 bic scno, r0, #__NR_OABI_SYSCALL_BASE
334 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE

--- 83 unchanged lines hidden (view full) ---

418 mov r2, r1
419 b sys_readahead
420ENDPROC(sys_oabi_readahead)
421
422/*
423 * Let's declare a second syscall table for old ABI binaries
424 * using the compatibility syscall entries.
425 */
410#define ABI(native, compat) compat
411#define OBSOLETE(syscall) syscall
426 syscall_table_start sys_oabi_call_table
427#define COMPAT(nr, native, compat) syscall nr, compat
428#include <calls-oabi.S>
429 syscall_table_end sys_oabi_call_table
412
430
413 .type sys_oabi_call_table, #object
414ENTRY(sys_oabi_call_table)
415#include "calls.S"
416#undef ABI
417#undef OBSOLETE
418
419#endif
420
431#endif
432