···180config ARCH_VERSATILE181 bool "Versatile"182 select ARM_AMBA0183 select ICST307184 help185 This enables support for ARM Ltd Versatile board.···401 Currently at least OMAP, PXA2xx and SA11x0 platforms are known402 to have accurate timekeeping with dynamic tick.40300000000000000000000000000000000404config ARCH_DISCONTIGMEM_ENABLE405 bool406 default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)···619620config FPE_NWFPE621 bool "NWFPE math emulation"0622 ---help---623 Say Y to include the NWFPE floating point emulator in the kernel.624 This is necessary to run most binaries. Linux does not currently···643644config FPE_FASTFPE645 bool "FastFPE math emulation (EXPERIMENTAL)"646- depends on !CPU_32v3 && EXPERIMENTAL647 ---help---648 Say Y here to include the FAST floating point emulator in the kernel.649 This is an experimental much faster emulator which now also has full···675676config ARTHUR677 tristate "RISC OS personality"0678 help679 Say Y here to include the kernel code necessary if you want to run680 Acorn RISC OS/Arthur binaries under Linux. This code is still very
···180config ARCH_VERSATILE181 bool "Versatile"182 select ARM_AMBA183+ select ARM_VIC184 select ICST307185 help186 This enables support for ARM Ltd Versatile board.···400 Currently at least OMAP, PXA2xx and SA11x0 platforms are known401 to have accurate timekeeping with dynamic tick.402403+config AEABI404+ bool "Use the ARM EABI to compile the kernel"405+ help406+ This option allows for the kernel to be compiled using the latest407+ ARM ABI (aka EABI). This is only useful if you are using a user408+ space environment that is also compiled with EABI.409+410+ Since there are major incompatibilities between the legacy ABI and411+ EABI, especially with regard to structure member alignment, this412+ option also changes the kernel syscall calling convention to413+ disambiguate both ABIs and allow for backward compatibility support414+ (selected with CONFIG_OABI_COMPAT).415+416+ To use this you need GCC version 4.0.0 or later.417+418+config OABI_COMPAT419+ bool "Allow old ABI binaries to run with this kernel"420+ depends on AEABI421+ default y422+ help423+ This option preserves the old syscall interface along with the424+ new (ARM EABI) one. It also provides a compatibility layer to425+ intercept syscalls that have structure arguments which layout426+ in memory differs between the legacy ABI and the new ARM EABI427+ (only for non "thumb" binaries). This option adds a tiny428+ overhead to all syscalls and produces a slightly larger kernel.429+ If you know you'll be using only pure EABI user space then you430+ can say N here. If this option is not selected and you attempt431+ to execute a legacy ABI binary then the result will be432+ UNPREDICTABLE (in fact it can be predicted that it won't work433+ at all). If in doubt say Y.434+435config ARCH_DISCONTIGMEM_ENABLE436 bool437 default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)···586587config FPE_NWFPE588 bool "NWFPE math emulation"589+ depends on !AEABI || OABI_COMPAT590 ---help---591 Say Y to include the NWFPE floating point emulator in the kernel.592 This is necessary to run most binaries. Linux does not currently···609610config FPE_FASTFPE611 bool "FastFPE math emulation (EXPERIMENTAL)"612+ depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL613 ---help---614 Say Y here to include the FAST floating point emulator in the kernel.615 This is an experimental much faster emulator which now also has full···641642config ARTHUR643 tristate "RISC OS personality"644+ depends on !AEABI645 help646 Say Y here to include the kernel code necessary if you want to run647 Acorn RISC OS/Arthur binaries under Linux. This code is still very
···1+/*2+ * linux/arch/arm/common/vic.c3+ *4+ * Copyright (C) 1999 - 2003 ARM Limited5+ * Copyright (C) 2000 Deep Blue Solutions Ltd6+ *7+ * This program is free software; you can redistribute it and/or modify8+ * it under the terms of the GNU General Public License as published by9+ * the Free Software Foundation; either version 2 of the License, or10+ * (at your option) any later version.11+ *12+ * This program is distributed in the hope that it will be useful,13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15+ * GNU General Public License for more details.16+ *17+ * You should have received a copy of the GNU General Public License18+ * along with this program; if not, write to the Free Software19+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20+ */21+#include <linux/init.h>22+#include <linux/list.h>23+24+#include <asm/io.h>25+#include <asm/irq.h>26+#include <asm/mach/irq.h>27+#include <asm/hardware/vic.h>28+29+static void __iomem *vic_base;30+31+static void vic_mask_irq(unsigned int irq)32+{33+ irq -= IRQ_VIC_START;34+ writel(1 << irq, vic_base + VIC_INT_ENABLE_CLEAR);35+}36+37+static void vic_unmask_irq(unsigned int irq)38+{39+ irq -= IRQ_VIC_START;40+ writel(1 << irq, vic_base + VIC_INT_ENABLE);41+}42+43+static struct irqchip vic_chip = {44+ .ack = vic_mask_irq,45+ .mask = vic_mask_irq,46+ .unmask = vic_unmask_irq,47+};48+49+void __init vic_init(void __iomem *base, u32 vic_sources)50+{51+ unsigned int i;52+53+ vic_base = base;54+55+ /* Disable all interrupts initially. */56+57+ writel(0, vic_base + VIC_INT_SELECT);58+ writel(0, vic_base + VIC_INT_ENABLE);59+ writel(~0, vic_base + VIC_INT_ENABLE_CLEAR);60+ writel(0, vic_base + VIC_IRQ_STATUS);61+ writel(0, vic_base + VIC_ITCR);62+ writel(~0, vic_base + VIC_INT_SOFT_CLEAR);63+64+ /*65+ * Make sure we clear all existing interrupts66+ */67+ writel(0, vic_base + VIC_VECT_ADDR);68+ for (i = 0; i < 19; i++) {69+ unsigned int value;70+71+ value = readl(vic_base + VIC_VECT_ADDR);72+ writel(value, vic_base + VIC_VECT_ADDR);73+ }74+75+ for (i = 0; i < 16; i++) {76+ void __iomem *reg = vic_base + VIC_VECT_CNTL0 + (i * 4);77+ writel(VIC_VECT_CNTL_ENABLE | i, reg);78+ }79+80+ writel(32, vic_base + VIC_DEF_VECT_ADDR);81+82+ for (i = 0; i < 32; i++) {83+ unsigned int irq = IRQ_VIC_START + i;84+85+ set_irq_chip(irq, &vic_chip);86+87+ if (vic_sources & (1 << i)) {88+ set_irq_handler(irq, do_level_IRQ);89+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);90+ }91+ }92+}
···3 *4 * Copyright (C) 1996,1997,1998 Russell King.5 * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)06 *7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License version 2 as···105/*106 * SVC mode handlers107 */0000000108 .macro svc_entry109 sub sp, sp, #S_FRAME_SIZE00110 stmib sp, {r1 - r12}111112 ldmia r0, {r1 - r3}113 add r5, sp, #S_SP @ here for interlock avoidance114 mov r4, #-1 @ "" "" "" ""115 add r0, sp, #S_FRAME_SIZE @ "" "" "" ""0116 str r1, [sp] @ save the "real" r0 copied117 @ from the exception stack118···313314/*315 * User mode handlers00316 */00000317 .macro usr_entry318 sub sp, sp, #S_FRAME_SIZE319 stmib sp, {r1 - r12}···556 add ip, r1, #TI_CPU_SAVE557 ldr r3, [r2, #TI_TP_VALUE]558 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack000559 ldr r6, [r2, #TI_CPU_DOMAIN]!0560#if __LINUX_ARM_ARCH__ >= 6561#ifdef CONFIG_CPU_MPCORE562 clrex···578 mov r4, #0xffff0fff579 str r3, [r4, #-15] @ TLS val at 0xffff0ff0580#endif0581 mcr p15, 0, r6, c3, c0, 0 @ Set domain register0582#ifdef CONFIG_VFP583 @ Always disable VFP so we can lazily save/restore the old584 @ state. This occurs in the context of the previous thread.
···3 *4 * Copyright (C) 1996,1997,1998 Russell King.5 * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)6+ * nommu support by Hyok S. Choi (hyok.choi@samsung.com)7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License version 2 as···104/*105 * SVC mode handlers106 */107+108+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)109+#define SPFIX(code...) code110+#else111+#define SPFIX(code...)112+#endif113+114 .macro svc_entry115 sub sp, sp, #S_FRAME_SIZE116+ SPFIX( tst sp, #4 )117+ SPFIX( bicne sp, sp, #4 )118 stmib sp, {r1 - r12}119120 ldmia r0, {r1 - r3}121 add r5, sp, #S_SP @ here for interlock avoidance122 mov r4, #-1 @ "" "" "" ""123 add r0, sp, #S_FRAME_SIZE @ "" "" "" ""124+ SPFIX( addne r0, r0, #4 )125 str r1, [sp] @ save the "real" r0 copied126 @ from the exception stack127···302303/*304 * User mode handlers305+ *306+ * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE307 */308+309+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)310+#error "sizeof(struct pt_regs) must be a multiple of 8"311+#endif312+313 .macro usr_entry314 sub sp, sp, #S_FRAME_SIZE315 stmib sp, {r1 - r12}···538 add ip, r1, #TI_CPU_SAVE539 ldr r3, [r2, #TI_TP_VALUE]540 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack541+#ifndef CONFIG_MMU542+ add r2, r2, #TI_CPU_DOMAIN543+#else544 ldr r6, [r2, #TI_CPU_DOMAIN]!545+#endif546#if __LINUX_ARM_ARCH__ >= 6547#ifdef CONFIG_CPU_MPCORE548 clrex···556 mov r4, #0xffff0fff557 str r3, [r4, #-15] @ TLS val at 0xffff0ff0558#endif559+#ifdef CONFIG_MMU560 mcr p15, 0, r6, c3, c0, 0 @ Set domain register561+#endif562#ifdef CONFIG_VFP563 @ Always disable VFP so we can lazily save/restore the old564 @ state. This occurs in the context of the previous thread.
+131-15
arch/arm/kernel/entry-common.S
···98 run on an ARM7 and we can save a couple of instructions. 99 --pb */100#ifdef CONFIG_CPU_ARM710101- .macro arm710_bug_check, instr, temp102- and \temp, \instr, #0x0f000000 @ check for SWI103- teq \temp, #0x0f000000104- bne .Larm700bug105- .endm106-107-.Larm700bug:108 ldmia sp, {r0 - lr}^ @ Get calling r0 - lr109 mov r0, r0110 add sp, sp, #S_FRAME_SIZE111 subs pc, lr, #4112#else113- .macro arm710_bug_check, instr, temp114- .endm115#endif116117 .align 5···123 /*124 * Get the system call number.125 */0000000126#ifdef CONFIG_ARM_THUMB00000000000000000000000127 tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs128 addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in129 ldreq scno, [lr, #-4]0130#else00131 ldr scno, [lr, #-4] @ get SWI instruction0000132#endif133- arm710_bug_check scno, ip134135#ifdef CONFIG_ALIGNMENT_TRAP136 ldr ip, __cr_alignment···175#endif176 enable_irq177178- stmdb sp!, {r4, r5} @ push fifth and sixth args179-180 get_thread_info tsk0181 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing000000000000182 bic scno, scno, #0xff000000 @ mask off SWI op-code183 eor scno, scno, #__NR_SYSCALL_BASE @ check OS number184- adr tbl, sys_call_table @ load syscall table pointer00185 tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?186 bne __sys_trace187188- adr lr, ret_fast_syscall @ return address189 cmp scno, #NR_syscalls @ check upper syscall limit0190 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine191192 add r1, sp, #S_OFF···214 * context switches, and waiting for our parent to respond.215 */216__sys_trace:0217 add r1, sp, #S_OFF218 mov r0, #0 @ trace entry [IP = 0]219 bl syscall_trace220221 adr lr, __sys_trace_return @ return address0222 add r1, sp, #S_R0 + S_OFF @ pointer to regs223 cmp scno, #NR_syscalls @ check upper syscall limit224 ldmccia r1, {r0 - r3} @ have to reload r0 - r3···229230__sys_trace_return:231 str r0, [sp, #S_R0 + S_OFF]! @ save returned r00232 mov r1, sp233 mov r0, #1 @ trace exit [IP = 1]234 bl syscall_trace···241__cr_alignment:242 .word cr_alignment243#endif000000000000244245 .type sys_call_table, #object246ENTRY(sys_call_table)247#include "calls.S"00248249/*============================================================================250 * Special system call wrappers···267@ r8 = syscall table268 .type sys_syscall, #function269sys_syscall:270- eor scno, r0, #__NR_SYSCALL_BASE271 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE272 cmpne scno, #NR_syscalls @ check range273 stmloia sp, {r5, r6} @ shuffle args···315 ldr r2, [sp, #S_OFF + S_SP]316 b do_sigaltstack3170000000000318/*319 * Note: off_4k (r5) is always units of 4K. If we can't do the requested320 * offset, we return EINVAL.···341 str r5, [sp, #4]342 b do_mmap2343#endif0000000000000000000000000000000000000000000000
···98 run on an ARM7 and we can save a couple of instructions. 99 --pb */100#ifdef CONFIG_CPU_ARM710101+#define A710(code...) code102+.Larm710bug:00000103 ldmia sp, {r0 - lr}^ @ Get calling r0 - lr104 mov r0, r0105 add sp, sp, #S_FRAME_SIZE106 subs pc, lr, #4107#else108+#define A710(code...)0109#endif110111 .align 5···129 /*130 * Get the system call number.131 */132+133+#if defined(CONFIG_OABI_COMPAT)134+135+ /*136+ * If we have CONFIG_OABI_COMPAT then we need to look at the swi137+ * value to determine if it is an EABI or an old ABI call.138+ */139#ifdef CONFIG_ARM_THUMB140+ tst r8, #PSR_T_BIT141+ movne r10, #0 @ no thumb OABI emulation142+ ldreq r10, [lr, #-4] @ get SWI instruction143+#else144+ ldr r10, [lr, #-4] @ get SWI instruction145+ A710( and ip, r10, #0x0f000000 @ check for SWI )146+ A710( teq ip, #0x0f000000 )147+ A710( bne .Larm710bug )148+#endif149+150+#elif defined(CONFIG_AEABI)151+152+ /*153+ * Pure EABI user space always put syscall number into scno (r7).154+ */155+ A710( ldr ip, [lr, #-4] @ get SWI instruction )156+ A710( and ip, ip, #0x0f000000 @ check for SWI )157+ A710( teq ip, #0x0f000000 )158+ A710( bne .Larm710bug )159+160+#elif defined(CONFIG_ARM_THUMB)161+162+ /* Legacy ABI only, possibly thumb mode. */163 tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs164 addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in165 ldreq scno, [lr, #-4]166+167#else168+169+ /* Legacy ABI only. */170 ldr scno, [lr, #-4] @ get SWI instruction171+ A710( and ip, scno, #0x0f000000 @ check for SWI )172+ A710( teq ip, #0x0f000000 )173+ A710( bne .Larm710bug )174+175#endif0176177#ifdef CONFIG_ALIGNMENT_TRAP178 ldr ip, __cr_alignment···145#endif146 enable_irq14700148 get_thread_info tsk149+ adr tbl, sys_call_table @ load syscall table pointer150 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing151+152+#if defined(CONFIG_OABI_COMPAT)153+ /*154+ * If the swi argument is zero, this is an EABI call and we do nothing.155+ *156+ * If this is an old ABI call, get the syscall number into scno and157+ * get the old ABI syscall table address.158+ */159+ bics r10, r10, #0xff000000160+ eorne scno, r10, #__NR_OABI_SYSCALL_BASE161+ ldrne tbl, =sys_oabi_call_table162+#elif !defined(CONFIG_AEABI)163 bic scno, scno, #0xff000000 @ mask off SWI op-code164 eor scno, scno, #__NR_SYSCALL_BASE @ check OS number165+#endif166+167+ stmdb sp!, {r4, r5} @ push fifth and sixth args168 tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?169 bne __sys_trace1700171 cmp scno, #NR_syscalls @ check upper syscall limit172+ adr lr, ret_fast_syscall @ return address173 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine174175 add r1, sp, #S_OFF···171 * context switches, and waiting for our parent to respond.172 */173__sys_trace:174+ mov r2, scno175 add r1, sp, #S_OFF176 mov r0, #0 @ trace entry [IP = 0]177 bl syscall_trace178179 adr lr, __sys_trace_return @ return address180+ mov scno, r0 @ syscall number (possibly new)181 add r1, sp, #S_R0 + S_OFF @ pointer to regs182 cmp scno, #NR_syscalls @ check upper syscall limit183 ldmccia r1, {r0 - r3} @ have to reload r0 - r3···184185__sys_trace_return:186 str r0, [sp, #S_R0 + S_OFF]! @ save returned r0187+ mov r2, scno188 mov r1, sp189 mov r0, #1 @ trace exit [IP = 1]190 bl syscall_trace···195__cr_alignment:196 .word cr_alignment197#endif198+ .ltorg199+200+/*201+ * This is the syscall table declaration for native ABI syscalls.202+ * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.203+ */204+#define ABI(native, compat) native205+#ifdef CONFIG_AEABI206+#define OBSOLETE(syscall) sys_ni_syscall207+#else208+#define OBSOLETE(syscall) syscall209+#endif210211 .type sys_call_table, #object212ENTRY(sys_call_table)213#include "calls.S"214+#undef ABI215+#undef OBSOLETE216217/*============================================================================218 * Special system call wrappers···207@ r8 = syscall table208 .type sys_syscall, #function209sys_syscall:210+ eor scno, r0, #__NR_OABI_SYSCALL_BASE211 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE212 cmpne scno, #NR_syscalls @ check range213 stmloia sp, {r5, r6} @ shuffle args···255 ldr r2, [sp, #S_OFF + S_SP]256 b do_sigaltstack257258+sys_statfs64_wrapper:259+ teq r1, #88260+ moveq r1, #84261+ b sys_statfs64262+263+sys_fstatfs64_wrapper:264+ teq r1, #88265+ moveq r1, #84266+ b sys_fstatfs64267+268/*269 * Note: off_4k (r5) is always units of 4K. If we can't do the requested270 * offset, we return EINVAL.···271 str r5, [sp, #4]272 b do_mmap2273#endif274+275+#ifdef CONFIG_OABI_COMPAT276+277+/*278+ * These are syscalls with argument register differences279+ */280+281+sys_oabi_pread64:282+ stmia sp, {r3, r4}283+ b sys_pread64284+285+sys_oabi_pwrite64:286+ stmia sp, {r3, r4}287+ b sys_pwrite64288+289+sys_oabi_truncate64:290+ mov r3, r2291+ mov r2, r1292+ b sys_truncate64293+294+sys_oabi_ftruncate64:295+ mov r3, r2296+ mov r2, r1297+ b sys_ftruncate64298+299+sys_oabi_readahead:300+ str r3, [sp]301+ mov r3, r2302+ mov r2, r1303+ b sys_readahead304+305+/*306+ * Let's declare a second syscall table for old ABI binaries307+ * using the compatibility syscall entries.308+ */309+#define ABI(native, compat) compat310+#define OBSOLETE(syscall) syscall311+312+ .type sys_oabi_call_table, #object313+ENTRY(sys_oabi_call_table)314+#include "calls.S"315+#undef ABI316+#undef OBSOLETE317+318+#endif319+
+1
arch/arm/kernel/entry-header.S
···19@20@ Most of the stack format comes from struct pt_regs, but with21@ the addition of 8 bytes for storing syscall args 5 and 6.022@23#define S_OFF 824
···19@20@ Most of the stack format comes from struct pt_regs, but with21@ the addition of 8 bytes for storing syscall args 5 and 6.22+@ This _must_ remain a multiple of 8 for EABI.23@24#define S_OFF 825
+3-4
arch/arm/kernel/head.S
···251 * r10 = procinfo252 *253 * Returns:254- * r0, r3, r5, r6, r7 corrupted255 * r4 = physical page table address256 */257 .type __create_page_tables, %function258__create_page_tables:259- ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram260 pgtbl r4 @ page table address261262 /*···302 * Then map first 1MB of ram in case it contains our boot params.303 */304 add r0, r4, #PAGE_OFFSET >> 18305- orr r6, r5, r7306 str r6, [r0]307308#ifdef CONFIG_XIP_KERNEL···310 * Map some ram to cover our .data and .bss areas.311 * Mapping 3MB should be plenty.312 */313- sub r3, r4, r5314 mov r3, r3, lsr #20315 add r0, r0, r3, lsl #2316 add r6, r6, r3, lsl #20
···251 * r10 = procinfo252 *253 * Returns:254+ * r0, r3, r6, r7 corrupted255 * r4 = physical page table address256 */257 .type __create_page_tables, %function258__create_page_tables:0259 pgtbl r4 @ page table address260261 /*···303 * Then map first 1MB of ram in case it contains our boot params.304 */305 add r0, r4, #PAGE_OFFSET >> 18306+ orr r6, r7, #PHYS_OFFSET307 str r6, [r0]308309#ifdef CONFIG_XIP_KERNEL···311 * Map some ram to cover our .data and .bss areas.312 * Mapping 3MB should be plenty.313 */314+ sub r3, r4, #PHYS_OFFSET315 mov r3, r3, lsr #20316 add r0, r0, r3, lsl #2317 add r6, r6, r3, lsl #20
+12-3
arch/arm/kernel/ptrace.c
···766 (unsigned long __user *) data);767 break;76800000769 default:770 ret = ptrace_request(child, request, addr, data);771 break;···779 return ret;780}781782-asmlinkage void syscall_trace(int why, struct pt_regs *regs)783{784 unsigned long ip;785786 if (!test_thread_flag(TIF_SYSCALL_TRACE))787- return;788 if (!(current->ptrace & PT_PTRACED))789- return;790791 /*792 * Save IP. IP is used to denote syscall entry/exit:···794 */795 ip = regs->ARM_ip;796 regs->ARM_ip = why;00797798 /* the 0x80 provides a way for the tracing parent to distinguish799 between a syscall stop and SIGTRAP delivery */···811 current->exit_code = 0;812 }813 regs->ARM_ip = ip;00814}
···766 (unsigned long __user *) data);767 break;768769+ case PTRACE_SET_SYSCALL:770+ ret = 0;771+ child->ptrace_message = data;772+ break;773+774 default:775 ret = ptrace_request(child, request, addr, data);776 break;···774 return ret;775}776777+asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)778{779 unsigned long ip;780781 if (!test_thread_flag(TIF_SYSCALL_TRACE))782+ return scno;783 if (!(current->ptrace & PT_PTRACED))784+ return scno;785786 /*787 * Save IP. IP is used to denote syscall entry/exit:···789 */790 ip = regs->ARM_ip;791 regs->ARM_ip = why;792+793+ current->ptrace_message = scno;794795 /* the 0x80 provides a way for the tracing parent to distinguish796 between a syscall stop and SIGTRAP delivery */···804 current->exit_code = 0;805 }806 regs->ARM_ip = ip;807+808+ return current->ptrace_message;809}
+9-8
arch/arm/kernel/semaphore.c
···177 * ip contains the semaphore pointer on entry. Save the C-clobbered178 * registers (r0 to r3 and lr), but not ip, as we use it as a return179 * value in some cases..0180 */181asm(" .section .sched.text,\"ax\",%progbits \n\182 .align 5 \n\183 .globl __down_failed \n\184__down_failed: \n\185- stmfd sp!, {r0 - r3, lr} \n\186 mov r0, ip \n\187 bl __down \n\188- ldmfd sp!, {r0 - r3, pc} \n\189 \n\190 .align 5 \n\191 .globl __down_interruptible_failed \n\192__down_interruptible_failed: \n\193- stmfd sp!, {r0 - r3, lr} \n\194 mov r0, ip \n\195 bl __down_interruptible \n\196 mov ip, r0 \n\197- ldmfd sp!, {r0 - r3, pc} \n\198 \n\199 .align 5 \n\200 .globl __down_trylock_failed \n\201__down_trylock_failed: \n\202- stmfd sp!, {r0 - r3, lr} \n\203 mov r0, ip \n\204 bl __down_trylock \n\205 mov ip, r0 \n\206- ldmfd sp!, {r0 - r3, pc} \n\207 \n\208 .align 5 \n\209 .globl __up_wakeup \n\210__up_wakeup: \n\211- stmfd sp!, {r0 - r3, lr} \n\212 mov r0, ip \n\213 bl __up \n\214- ldmfd sp!, {r0 - r3, pc} \n\215 ");216217EXPORT_SYMBOL(__down_failed);
···177 * ip contains the semaphore pointer on entry. Save the C-clobbered178 * registers (r0 to r3 and lr), but not ip, as we use it as a return179 * value in some cases..180+ * To remain AAPCS compliant (64-bit stack align) we save r4 as well.181 */182asm(" .section .sched.text,\"ax\",%progbits \n\183 .align 5 \n\184 .globl __down_failed \n\185__down_failed: \n\186+ stmfd sp!, {r0 - r4, lr} \n\187 mov r0, ip \n\188 bl __down \n\189+ ldmfd sp!, {r0 - r4, pc} \n\190 \n\191 .align 5 \n\192 .globl __down_interruptible_failed \n\193__down_interruptible_failed: \n\194+ stmfd sp!, {r0 - r4, lr} \n\195 mov r0, ip \n\196 bl __down_interruptible \n\197 mov ip, r0 \n\198+ ldmfd sp!, {r0 - r4, pc} \n\199 \n\200 .align 5 \n\201 .globl __down_trylock_failed \n\202__down_trylock_failed: \n\203+ stmfd sp!, {r0 - r4, lr} \n\204 mov r0, ip \n\205 bl __down_trylock \n\206 mov ip, r0 \n\207+ ldmfd sp!, {r0 - r4, pc} \n\208 \n\209 .align 5 \n\210 .globl __up_wakeup \n\211__up_wakeup: \n\212+ stmfd sp!, {r0 - r4, lr} \n\213 mov r0, ip \n\214 bl __up \n\215+ ldmfd sp!, {r0 - r4, pc} \n\216 ");217218EXPORT_SYMBOL(__down_failed);
+2
arch/arm/kernel/sys_arm.c
···147 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);148}1490150/*151 * sys_ipc() is the de-multiplexer for the SysV IPC calls..152 *···227 return -ENOSYS;228 }229}0230231/* Fork a new task - this creates a new program thread.232 * This is called indirectly via a small wrapper
···147 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);148}149150+#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)151/*152 * sys_ipc() is the de-multiplexer for the SysV IPC calls..153 *···226 return -ENOSYS;227 }228}229+#endif230231/* Fork a new task - this creates a new program thread.232 * This is called indirectly via a small wrapper
···1+/*2+ * arch/arm/kernel/sys_oabi-compat.c3+ *4+ * Compatibility wrappers for syscalls that are used from5+ * old ABI user space binaries with an EABI kernel.6+ *7+ * Author: Nicolas Pitre8+ * Created: Oct 7, 20059+ * Copyright: MontaVista Software, Inc.10+ *11+ * This program is free software; you can redistribute it and/or modify12+ * it under the terms of the GNU General Public License version 2 as13+ * published by the Free Software Foundation.14+ */15+16+/*17+ * The legacy ABI and the new ARM EABI have different rules making some18+ * syscalls incompatible especially with structure arguments.19+ * Most notably, Eabi says 64-bit members should be 64-bit aligned instead of20+ * simply word aligned. EABI also pads structures to the size of the largest21+ * member it contains instead of the invariant 32-bit.22+ *23+ * The following syscalls are affected:24+ *25+ * sys_stat64:26+ * sys_lstat64:27+ * sys_fstat64:28+ *29+ * struct stat64 has different sizes and some members are shifted30+ * Compatibility wrappers are needed for them and provided below.31+ *32+ * sys_fcntl64:33+ *34+ * struct flock64 has different sizes and some members are shifted35+ * A compatibility wrapper is needed and provided below.36+ *37+ * sys_statfs64:38+ * sys_fstatfs64:39+ *40+ * struct statfs64 has extra padding with EABI growing its size from41+ * 84 to 88. This struct is now __attribute__((packed,aligned(4)))42+ * with a small assembly wrapper to force the sz argument to 84 if it is 8843+ * to avoid copying the extra padding over user space unexpecting it.44+ *45+ * sys_newuname:46+ *47+ * struct new_utsname has no padding with EABI. No problem there.48+ *49+ * sys_epoll_ctl:50+ * sys_epoll_wait:51+ *52+ * struct epoll_event has its second member shifted also affecting the53+ * structure size. Compatibility wrappers are needed and provided below.54+ *55+ * sys_ipc:56+ * sys_semop:57+ * sys_semtimedop:58+ *59+ * struct sembuf loses its padding with EABI. Since arrays of them are60+ * used they have to be copyed to remove the padding. Compatibility wrappers61+ * provided below.62+ */63+64+#include <linux/syscalls.h>65+#include <linux/errno.h>66+#include <linux/fs.h>67+#include <linux/fcntl.h>68+#include <linux/eventpoll.h>69+#include <linux/sem.h>70+#include <asm/ipc.h>71+#include <asm/uaccess.h>72+73+struct oldabi_stat64 {74+ unsigned long long st_dev;75+ unsigned int __pad1;76+ unsigned long __st_ino;77+ unsigned int st_mode;78+ unsigned int st_nlink;79+80+ unsigned long st_uid;81+ unsigned long st_gid;82+83+ unsigned long long st_rdev;84+ unsigned int __pad2;85+86+ long long st_size;87+ unsigned long st_blksize;88+ unsigned long long st_blocks;89+90+ unsigned long st_atime;91+ unsigned long st_atime_nsec;92+93+ unsigned long st_mtime;94+ unsigned long st_mtime_nsec;95+96+ unsigned long st_ctime;97+ unsigned long st_ctime_nsec;98+99+ unsigned long long st_ino;100+} __attribute__ ((packed,aligned(4)));101+102+static long cp_oldabi_stat64(struct kstat *stat,103+ struct oldabi_stat64 __user *statbuf)104+{105+ struct oldabi_stat64 tmp;106+107+ tmp.st_dev = huge_encode_dev(stat->dev);108+ tmp.__pad1 = 0;109+ tmp.__st_ino = stat->ino;110+ tmp.st_mode = stat->mode;111+ tmp.st_nlink = stat->nlink;112+ tmp.st_uid = stat->uid;113+ tmp.st_gid = stat->gid;114+ tmp.st_rdev = huge_encode_dev(stat->rdev);115+ tmp.st_size = stat->size;116+ tmp.st_blocks = stat->blocks;117+ tmp.__pad2 = 0;118+ tmp.st_blksize = stat->blksize;119+ tmp.st_atime = stat->atime.tv_sec;120+ tmp.st_atime_nsec = stat->atime.tv_nsec;121+ tmp.st_mtime = stat->mtime.tv_sec;122+ tmp.st_mtime_nsec = stat->mtime.tv_nsec;123+ tmp.st_ctime = stat->ctime.tv_sec;124+ tmp.st_ctime_nsec = stat->ctime.tv_nsec;125+ tmp.st_ino = stat->ino;126+ return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;127+}128+129+asmlinkage long sys_oabi_stat64(char __user * filename,130+ struct oldabi_stat64 __user * statbuf)131+{132+ struct kstat stat;133+ int error = vfs_stat(filename, &stat);134+ if (!error)135+ error = cp_oldabi_stat64(&stat, statbuf);136+ return error;137+}138+139+asmlinkage long sys_oabi_lstat64(char __user * filename,140+ struct oldabi_stat64 __user * statbuf)141+{142+ struct kstat stat;143+ int error = vfs_lstat(filename, &stat);144+ if (!error)145+ error = cp_oldabi_stat64(&stat, statbuf);146+ return error;147+}148+149+asmlinkage long sys_oabi_fstat64(unsigned long fd,150+ struct oldabi_stat64 __user * statbuf)151+{152+ struct kstat stat;153+ int error = vfs_fstat(fd, &stat);154+ if (!error)155+ error = cp_oldabi_stat64(&stat, statbuf);156+ return error;157+}158+159+struct oabi_flock64 {160+ short l_type;161+ short l_whence;162+ loff_t l_start;163+ loff_t l_len;164+ pid_t l_pid;165+} __attribute__ ((packed,aligned(4)));166+167+asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,168+ unsigned long arg)169+{170+ struct oabi_flock64 user;171+ struct flock64 kernel;172+ mm_segment_t fs = USER_DS; /* initialized to kill a warning */173+ unsigned long local_arg = arg;174+ int ret;175+176+ switch (cmd) {177+ case F_GETLK64:178+ case F_SETLK64:179+ case F_SETLKW64:180+ if (copy_from_user(&user, (struct oabi_flock64 __user *)arg,181+ sizeof(user)))182+ return -EFAULT;183+ kernel.l_type = user.l_type;184+ kernel.l_whence = user.l_whence;185+ kernel.l_start = user.l_start;186+ kernel.l_len = user.l_len;187+ kernel.l_pid = user.l_pid;188+ local_arg = (unsigned long)&kernel;189+ fs = get_fs();190+ set_fs(KERNEL_DS);191+ }192+193+ ret = sys_fcntl64(fd, cmd, local_arg);194+195+ switch (cmd) {196+ case F_GETLK64:197+ if (!ret) {198+ user.l_type = kernel.l_type;199+ user.l_whence = kernel.l_whence;200+ user.l_start = kernel.l_start;201+ user.l_len = kernel.l_len;202+ user.l_pid = kernel.l_pid;203+ if (copy_to_user((struct oabi_flock64 __user *)arg,204+ &user, sizeof(user)))205+ ret = -EFAULT;206+ }207+ case F_SETLK64:208+ case F_SETLKW64:209+ set_fs(fs);210+ }211+212+ return ret;213+}214+215+struct oabi_epoll_event {216+ __u32 events;217+ __u64 data;218+} __attribute__ ((packed,aligned(4)));219+220+asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,221+ struct oabi_epoll_event __user *event)222+{223+ struct oabi_epoll_event user;224+ struct epoll_event kernel;225+ mm_segment_t fs;226+ long ret;227+228+ if (op == EPOLL_CTL_DEL)229+ return sys_epoll_ctl(epfd, op, fd, NULL);230+ if (copy_from_user(&user, event, sizeof(user)))231+ return -EFAULT;232+ kernel.events = user.events;233+ kernel.data = user.data;234+ fs = get_fs();235+ set_fs(KERNEL_DS);236+ ret = sys_epoll_ctl(epfd, op, fd, &kernel);237+ set_fs(fs);238+ return ret;239+}240+241+asmlinkage long sys_oabi_epoll_wait(int epfd,242+ struct oabi_epoll_event __user *events,243+ int maxevents, int timeout)244+{245+ struct epoll_event *kbuf;246+ mm_segment_t fs;247+ long ret, err, i;248+249+ if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event)))250+ return -EINVAL;251+ kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL);252+ if (!kbuf)253+ return -ENOMEM;254+ fs = get_fs();255+ set_fs(KERNEL_DS);256+ ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout);257+ set_fs(fs);258+ err = 0;259+ for (i = 0; i < ret; i++) {260+ __put_user_error(kbuf[i].events, &events->events, err);261+ __put_user_error(kbuf[i].data, &events->data, err);262+ events++;263+ }264+ kfree(kbuf);265+ return err ? -EFAULT : ret;266+}267+268+struct oabi_sembuf {269+ unsigned short sem_num;270+ short sem_op;271+ short sem_flg;272+ unsigned short __pad;273+};274+275+asmlinkage long sys_oabi_semtimedop(int semid,276+ struct oabi_sembuf __user *tsops,277+ unsigned nsops,278+ const struct timespec __user *timeout)279+{280+ struct sembuf *sops;281+ struct timespec local_timeout;282+ long err;283+ int i;284+285+ if (nsops < 1)286+ return -EINVAL;287+ sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);288+ if (!sops)289+ return -ENOMEM;290+ err = 0;291+ for (i = 0; i < nsops; i++) {292+ __get_user_error(sops[i].sem_num, &tsops->sem_num, err);293+ __get_user_error(sops[i].sem_op, &tsops->sem_op, err);294+ __get_user_error(sops[i].sem_flg, &tsops->sem_flg, err);295+ tsops++;296+ }297+ if (timeout) {298+ /* copy this as well before changing domain protection */299+ err |= copy_from_user(&local_timeout, timeout, sizeof(*timeout));300+ timeout = &local_timeout;301+ }302+ if (err) {303+ err = -EFAULT;304+ } else {305+ mm_segment_t fs = get_fs();306+ set_fs(KERNEL_DS);307+ err = sys_semtimedop(semid, sops, nsops, timeout);308+ set_fs(fs);309+ }310+ kfree(sops);311+ return err;312+}313+314+asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops,315+ unsigned nsops)316+{317+ return sys_oabi_semtimedop(semid, tsops, nsops, NULL);318+}319+320+extern asmlinkage int sys_ipc(uint call, int first, int second, int third,321+ void __user *ptr, long fifth);322+323+asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,324+ void __user *ptr, long fifth)325+{326+ switch (call & 0xffff) {327+ case SEMOP:328+ return sys_oabi_semtimedop(first,329+ (struct oabi_sembuf __user *)ptr,330+ second, NULL);331+ case SEMTIMEDOP:332+ return sys_oabi_semtimedop(first,333+ (struct oabi_sembuf __user *)ptr,334+ second,335+ (const struct timespec __user *)fifth);336+ default:337+ return sys_ipc(call, first, second, third, ptr, fifth);338+ }339+}
···34config MACH_REALVIEW_EB5 bool "Support RealView/EB platform"6- default n7 select ARM_GIC8 help9 Include support for the ARM(R) RealView Emulation Baseboard platform.
···34config MACH_REALVIEW_EB5 bool "Support RealView/EB platform"06 select ARM_GIC7 help8 Include support for the ARM(R) RealView Emulation Baseboard platform.
···62#else63 u32 padding[3];64#endif65-} FPREG;6667/*68 * FPA11 device model.···89 so we can use it to detect whether this90 instance of the emulator needs to be91 initialised. */92-} FPA11;9394extern int8 SetRoundingMode(const unsigned int);95extern int8 SetRoundingPrecision(const unsigned int);
···62#else63 u32 padding[3];64#endif65+} __attribute__ ((packed,aligned(4))) FPREG;6667/*68 * FPA11 device model.···89 so we can use it to detect whether this90 instance of the emulator needs to be91 initialised. */92+} __attribute__ ((packed,aligned(4))) FPA11;9394extern int8 SetRoundingMode(const unsigned int);95extern int8 SetRoundingPrecision(const unsigned int);
-3
arch/arm/plat-omap/Kconfig
···22config OMAP_RESET_CLOCKS23 bool "Reset unused clocks during boot"24 depends on ARCH_OMAP25- default n26 help27 Say Y if you want to reset unused clocks during boot.28 This option saves power, but assumes all drivers are···43config OMAP_MUX_DEBUG44 bool "Multiplexing debug output"45 depends on OMAP_MUX46- default n47 help48 Makes the multiplexing functions print out a lot of debug info.49 This is useful if you want to find out the correct values of the···9192config OMAP_DM_TIMER93 bool "Use dual-mode timer"94- default n95 depends on ARCH_OMAP16XX96 help97 Select this option if you want to use OMAP Dual-Mode timers.
···22config OMAP_RESET_CLOCKS23 bool "Reset unused clocks during boot"24 depends on ARCH_OMAP025 help26 Say Y if you want to reset unused clocks during boot.27 This option saves power, but assumes all drivers are···44config OMAP_MUX_DEBUG45 bool "Multiplexing debug output"46 depends on OMAP_MUX047 help48 Makes the multiplexing functions print out a lot of debug info.49 This is useful if you want to find out the correct values of the···9394config OMAP_DM_TIMER95 bool "Use dual-mode timer"096 depends on ARCH_OMAP16XX97 help98 Select this option if you want to use OMAP Dual-Mode timers.
+1-1
drivers/serial/imx.c
···499 ucr2 |= UCR2_STPB;500 if (termios->c_cflag & PARENB) {501 ucr2 |= UCR2_PREN;502- if (!(termios->c_cflag & PARODD))503 ucr2 |= UCR2_PROE;504 }505
···499 ucr2 |= UCR2_STPB;500 if (termios->c_cflag & PARENB) {501 ucr2 |= UCR2_PREN;502+ if (termios->c_cflag & PARODD)503 ucr2 |= UCR2_PROE;504 }505
···293 * VERSATILE_SYS_IC 294 * 295 */296+/* VIC definitions in include/asm-arm/hardware/vic.h */0000000000000000000297298#define SIC_IRQ_STATUS 0299#define SIC_IRQ_RAW_STATUS 0x04···324#define SIC_INT_PIC_ENABLE 0x20 /* read status of pass through mask */325#define SIC_INT_PIC_ENABLES 0x20 /* set interrupt pass through bits */326#define SIC_INT_PIC_ENABLEC 0x24 /* Clear interrupt pass through bits */00327328/* ------------------------------------------------------------------------329 * Interrupts - bit assignment (primary)
+45
include/asm-arm/hardware/vic.h
···000000000000000000000000000000000000000000000
···1+/*2+ * linux/include/asm-arm/hardware/vic.h3+ *4+ * Copyright (c) ARM Limited 2003. All rights reserved.5+ *6+ * This program is free software; you can redistribute it and/or modify7+ * it under the terms of the GNU General Public License as published by8+ * the Free Software Foundation; either version 2 of the License, or9+ * (at your option) any later version.10+ *11+ * This program is distributed in the hope that it will be useful,12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14+ * GNU General Public License for more details.15+ *16+ * You should have received a copy of the GNU General Public License17+ * along with this program; if not, write to the Free Software18+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19+ */20+#ifndef __ASM_ARM_HARDWARE_VIC_H21+#define __ASM_ARM_HARDWARE_VIC_H22+23+#define VIC_IRQ_STATUS 0x0024+#define VIC_FIQ_STATUS 0x0425+#define VIC_RAW_STATUS 0x0826+#define VIC_INT_SELECT 0x0c /* 1 = FIQ, 0 = IRQ */27+#define VIC_INT_ENABLE 0x10 /* 1 = enable, 0 = disable */28+#define VIC_INT_ENABLE_CLEAR 0x1429+#define VIC_INT_SOFT 0x1830+#define VIC_INT_SOFT_CLEAR 0x1c31+#define VIC_PROTECT 0x2032+#define VIC_VECT_ADDR 0x3033+#define VIC_DEF_VECT_ADDR 0x3434+35+#define VIC_VECT_ADDR0 0x100 /* 0 to 15 */36+#define VIC_VECT_CNTL0 0x200 /* 0 to 15 */37+#define VIC_ITCR 0x300 /* VIC test control register */38+39+#define VIC_VECT_CNTL_ENABLE (1 << 5)40+41+#ifndef __ASSEMBLY__42+void vic_init(void __iomem *base, u32 vic_sources);43+#endif44+45+#endif
+1-1
include/asm-arm/mach/arch.h
···20 * by assembler code in head-armv.S21 */22 unsigned int nr; /* architecture number */23- unsigned int phys_ram; /* start of physical ram */24 unsigned int phys_io; /* start of physical io */25 unsigned int io_pg_offst; /* byte offset for io 26 * page tabe entry */
···20 * by assembler code in head-armv.S21 */22 unsigned int nr; /* architecture number */23+ unsigned int __deprecated phys_ram; /* start of physical ram */24 unsigned int phys_io; /* start of physical io */25 unsigned int io_pg_offst; /* byte offset for io 26 * page tabe entry */
···4950#define INIT_THREAD { }5152+#ifdef CONFIG_MMU53+#define nommu_start_thread(regs) do { } while (0)54+#else55+#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data56+#endif57+58#define start_thread(regs,pc,sp) \59({ \60 unsigned long *stack = (unsigned long *)sp; \···65 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \66 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \67 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \68+ nommu_start_thread(regs); \69})7071/* Forward declaration, a strange C thing */
+8-3
include/asm-arm/ptrace.h
···23#define PTRACE_OLDSETOPTIONS 212425#define PTRACE_GET_THREAD_AREA 2200026/*27 * PSR bits28 */···6364#ifndef __ASSEMBLY__6566-/* this struct defines the way the registers are stored on the67- stack during a system call. */68-0069struct pt_regs {70 long uregs[18];71};
···23#define PTRACE_OLDSETOPTIONS 212425#define PTRACE_GET_THREAD_AREA 2226+27+#define PTRACE_SET_SYSCALL 2328+29/*30 * PSR bits31 */···6061#ifndef __ASSEMBLY__6263+/*64+ * This struct defines the way the registers are stored on the65+ * stack during a system call. Note that sizeof(struct pt_regs)66+ * has to be a multiple of 8.67+ */68struct pt_regs {69 long uregs[18];70};
+2-9
include/asm-arm/stat.h
···7071 long long st_size;72 unsigned long st_blksize;73-74-#if defined(__ARMEB__)75- unsigned long __pad4; /* Future possible st_blocks hi bits */76- unsigned long st_blocks; /* Number 512-byte blocks allocated. */77-#else /* Must be little */78- unsigned long st_blocks; /* Number 512-byte blocks allocated. */79- unsigned long __pad4; /* Future possible st_blocks hi bits */80-#endif8182 unsigned long st_atime;83 unsigned long st_atime_nsec;···82 unsigned long st_ctime_nsec;8384 unsigned long long st_ino;85-} __attribute__((packed));8687#endif
···7071 long long st_size;72 unsigned long st_blksize;73+ unsigned long long st_blocks; /* Number 512-byte blocks allocated. */00000007475 unsigned long st_atime;76 unsigned long st_atime_nsec;···89 unsigned long st_ctime_nsec;9091 unsigned long long st_ino;92+};9394#endif
···1#ifndef _ASMARM_STATFS_H2#define _ASMARM_STATFS_H34+#ifndef __KERNEL_STRICT_NAMES5+# include <linux/types.h>6+typedef __kernel_fsid_t fsid_t;7+#endif8+9+struct statfs {10+ __u32 f_type;11+ __u32 f_bsize;12+ __u32 f_blocks;13+ __u32 f_bfree;14+ __u32 f_bavail;15+ __u32 f_files;16+ __u32 f_ffree;17+ __kernel_fsid_t f_fsid;18+ __u32 f_namelen;19+ __u32 f_frsize;20+ __u32 f_spare[5];21+};22+23+/*24+ * With EABI there is 4 bytes of padding added to this structure.25+ * Let's pack it so the padding goes away to simplify dual ABI support.26+ * Note that user space does NOT have to pack this structure.27+ */28+struct statfs64 {29+ __u32 f_type;30+ __u32 f_bsize;31+ __u64 f_blocks;32+ __u64 f_bfree;33+ __u64 f_bavail;34+ __u64 f_files;35+ __u64 f_ffree;36+ __kernel_fsid_t f_fsid;37+ __u32 f_namelen;38+ __u32 f_frsize;39+ __u32 f_spare[5];40+} __attribute__ ((packed,aligned(4)));4142#endif