Path: blob/master/arch/blackfin/mach-common/entry.S
10817 views
/*1* Contains the system-call and fault low-level handling routines.2* This also contains the timer-interrupt handler, as well as all3* interrupts and faults that can result in a task-switch.4*5* Copyright 2005-2009 Analog Devices Inc.6*7* Licensed under the GPL-2 or later.8*/910/* NOTE: This code handles signal-recognition, which happens every time11* after a timer-interrupt and after each system call.12*/1314#include <linux/init.h>15#include <linux/linkage.h>16#include <linux/unistd.h>17#include <asm/blackfin.h>18#include <asm/errno.h>19#include <asm/fixed_code.h>20#include <asm/thread_info.h> /* TIF_NEED_RESCHED */21#include <asm/asm-offsets.h>22#include <asm/trace.h>23#include <asm/traps.h>2425#include <asm/context.S>2627#if defined(CONFIG_BFIN_SCRATCH_REG_RETN)28# define EX_SCRATCH_REG RETN29#elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)30# define EX_SCRATCH_REG RETE31#else32# define EX_SCRATCH_REG CYCLES33#endif3435#ifdef CONFIG_EXCPT_IRQ_SYSC_L136.section .l1.text37#else38.text39#endif4041/* Slightly simplified and streamlined entry point for CPLB misses.42* This one does not lower the level to IRQ5, and thus can be used to43* patch up CPLB misses on the kernel stack.44*/45#if ANOMALY_0500026146#define _ex_dviol _ex_workaround_26147#define _ex_dmiss _ex_workaround_26148#define _ex_dmult _ex_workaround_2614950ENTRY(_ex_workaround_261)51/*52* Work around an anomaly: if we see a new DCPLB fault, return53* without doing anything. Then, if we get the same fault again,54* handle it.55*/56P4 = R7; /* Store EXCAUSE */5758GET_PDA(p5, r7);59r7 = [p5 + PDA_LFRETX];60r6 = retx;61[p5 + PDA_LFRETX] = r6;62cc = r6 == r7;63if !cc jump _bfin_return_from_exception;64/* fall through */65R7 = P4;66R6 = VEC_CPLB_M; /* Data CPLB Miss */67cc = R6 == R7;68if cc jump _ex_dcplb_miss (BP);69#ifdef CONFIG_MPU70R6 = VEC_CPLB_VL; /* Data CPLB Violation */71cc = R6 == R7;72if cc jump _ex_dcplb_viol (BP);73#endif74/* Handle Data CPLB Protection Violation75* and Data CPLB Multiple Hits - Linux Trap Zero76*/77jump _ex_trap_c;78ENDPROC(_ex_workaround_261)7980#else81#ifdef CONFIG_MPU82#define _ex_dviol _ex_dcplb_viol83#else84#define _ex_dviol _ex_trap_c85#endif86#define _ex_dmiss _ex_dcplb_miss87#define _ex_dmult _ex_trap_c88#endif899091ENTRY(_ex_dcplb_viol)92ENTRY(_ex_dcplb_miss)93ENTRY(_ex_icplb_miss)94(R7:6,P5:4) = [sp++];95/* We leave the previously pushed ASTAT on the stack. */96SAVE_CONTEXT_CPLB9798/* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that99* will change the stack pointer. */100R0 = SEQSTAT;101R1 = SP;102103DEBUG_HWTRACE_SAVE(p5, r7)104105sp += -12;106call _cplb_hdr;107sp += 12;108CC = R0 == 0;109IF !CC JUMP _handle_bad_cplb;110111#ifdef CONFIG_DEBUG_DOUBLEFAULT112/* While we were processing this, did we double fault? */113r7 = SEQSTAT; /* reason code is in bit 5:0 */114r6.l = lo(SEQSTAT_EXCAUSE);115r6.h = hi(SEQSTAT_EXCAUSE);116r7 = r7 & r6;117r6 = 0x25;118CC = R7 == R6;119if CC JUMP _double_fault;120#endif121122DEBUG_HWTRACE_RESTORE(p5, r7)123RESTORE_CONTEXT_CPLB124ASTAT = [SP++];125SP = EX_SCRATCH_REG;126rtx;127ENDPROC(_ex_icplb_miss)128129ENTRY(_ex_syscall)130raise 15; /* invoked by TRAP #0, for sys call */131jump.s _bfin_return_from_exception;132ENDPROC(_ex_syscall)133134ENTRY(_ex_single_step)135/* If we just returned from an interrupt, the single step event is136for the RTI instruction. */137r7 = retx;138r6 = reti;139cc = r7 == r6;140if cc jump _bfin_return_from_exception;141142#ifdef CONFIG_KGDB143/* Don't do single step in hardware exception handler */144p5.l = lo(IPEND);145p5.h = hi(IPEND);146r6 = [p5];147cc = bittst(r6, 4);148if cc jump _bfin_return_from_exception;149cc = bittst(r6, 5);150if cc jump _bfin_return_from_exception;151152/* skip single step if current interrupt priority is higher than153* that of the first instruction, from which gdb starts single step */154r6 >>= 6;155r7 = 10;156.Lfind_priority_start:157cc = bittst(r6, 0);158if cc jump .Lfind_priority_done;159r6 >>= 1;160r7 += -1;161cc = r7 == 0;162if cc jump .Lfind_priority_done;163jump.s .Lfind_priority_start;164.Lfind_priority_done:165p4.l = _kgdb_single_step;166p4.h = _kgdb_single_step;167r6 = [p4];168cc = r6 == 0;169if cc jump .Ldo_single_step;170r6 += -1;171cc = r6 < r7;172if cc jump 1f;173.Ldo_single_step:174#else175/* If we were in user mode, do the single step normally. */176p5.l = lo(IPEND);177p5.h = hi(IPEND);178r6 = [p5];179r7 = 0xffe0 (z);180r7 = r7 & r6;181cc = r7 == 0;182if !cc jump 1f;183#endif184#ifdef CONFIG_EXACT_HWERR185/* Read the ILAT, and to check to see if the process we are186* single stepping caused a previous hardware error187* If so, do not single step, (which lowers to IRQ5, and makes188* us miss the error).189*/190p5.l = lo(ILAT);191p5.h = hi(ILAT);192r7 = [p5];193cc = bittst(r7, EVT_IVHW_P);194if cc jump 1f;195#endif196/* Single stepping only a single instruction, so clear the trace197* bit here. */198r7 = syscfg;199bitclr (r7, SYSCFG_SSSTEP_P);200syscfg = R7;201jump _ex_trap_c;2022031:204/*205* We were in an interrupt handler. By convention, all of them save206* SYSCFG with their first instruction, so by checking whether our207* RETX points at the entry point, we can determine whether to allow208* a single step, or whether to clear SYSCFG.209*210* First, find out the interrupt level and the event vector for it.211*/212p5.l = lo(EVT0);213p5.h = hi(EVT0);214p5 += -4;2152:216r7 = rot r7 by -1;217p5 += 4;218if !cc jump 2b;219220/* What we actually do is test for the _second_ instruction in the221* IRQ handler. That way, if there are insns following the restore222* of SYSCFG after leaving the handler, we will not turn off SYSCFG223* for them. */224225r7 = [p5];226r7 += 2;227r6 = RETX;228cc = R7 == R6;229if !cc jump _bfin_return_from_exception;230231r7 = syscfg;232bitclr (r7, SYSCFG_SSSTEP_P); /* Turn off single step */233syscfg = R7;234235/* Fall through to _bfin_return_from_exception. */236ENDPROC(_ex_single_step)237238ENTRY(_bfin_return_from_exception)239#if ANOMALY_05000257240R7=LC0;241LC0=R7;242R7=LC1;243LC1=R7;244#endif245246#ifdef CONFIG_DEBUG_DOUBLEFAULT247/* While we were processing the current exception,248* did we cause another, and double fault?249*/250r7 = SEQSTAT; /* reason code is in bit 5:0 */251r6.l = lo(SEQSTAT_EXCAUSE);252r6.h = hi(SEQSTAT_EXCAUSE);253r7 = r7 & r6;254r6 = VEC_UNCOV;255CC = R7 == R6;256if CC JUMP _double_fault;257#endif258259(R7:6,P5:4) = [sp++];260ASTAT = [sp++];261sp = EX_SCRATCH_REG;262rtx;263ENDPROC(_bfin_return_from_exception)264265ENTRY(_handle_bad_cplb)266DEBUG_HWTRACE_RESTORE(p5, r7)267/* To get here, we just tried and failed to change a CPLB268* so, handle things in trap_c (C code), by lowering to269* IRQ5, just like we normally do. Since this is not a270* "normal" return path, we have a do a lot of stuff to271* the stack to get ready so, we can fall through - we272* need to make a CPLB exception look like a normal exception273*/274RESTORE_CONTEXT_CPLB275/* ASTAT is still on the stack, where it is needed. */276[--sp] = (R7:6,P5:4);277278ENTRY(_ex_replaceable)279nop;280281ENTRY(_ex_trap_c)282/* The only thing that has been saved in this context is283* (R7:6,P5:4), ASTAT & SP - don't use anything else284*/285286GET_PDA(p5, r6);287288/* Make sure we are not in a double fault */289p4.l = lo(IPEND);290p4.h = hi(IPEND);291r7 = [p4];292CC = BITTST (r7, 5);293if CC jump _double_fault;294[p5 + PDA_EXIPEND] = r7;295296/* Call C code (trap_c) to handle the exception, which most297* likely involves sending a signal to the current process.298* To avoid double faults, lower our priority to IRQ5 first.299*/300r7.h = _exception_to_level5;301r7.l = _exception_to_level5;302p4.l = lo(EVT5);303p4.h = hi(EVT5);304[p4] = r7;305csync;306307/*308* Save these registers, as they are only valid in exception context309* (where we are now - as soon as we defer to IRQ5, they can change)310* DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,311* but they are not very interesting, so don't save them312*/313314p4.l = lo(DCPLB_FAULT_ADDR);315p4.h = hi(DCPLB_FAULT_ADDR);316r7 = [p4];317[p5 + PDA_DCPLB] = r7;318319p4.l = lo(ICPLB_FAULT_ADDR);320p4.h = hi(ICPLB_FAULT_ADDR);321r6 = [p4];322[p5 + PDA_ICPLB] = r6;323324r6 = retx;325[p5 + PDA_RETX] = r6;326327r6 = SEQSTAT;328[p5 + PDA_SEQSTAT] = r6;329330/* Save the state of single stepping */331r6 = SYSCFG;332[p5 + PDA_SYSCFG] = r6;333/* Clear it while we handle the exception in IRQ5 mode */334BITCLR(r6, SYSCFG_SSSTEP_P);335SYSCFG = r6;336337/* Save the current IMASK, since we change in order to jump to level 5 */338cli r6;339[p5 + PDA_EXIMASK] = r6;340341p4.l = lo(SAFE_USER_INSTRUCTION);342p4.h = hi(SAFE_USER_INSTRUCTION);343retx = p4;344345/* Disable all interrupts, but make sure level 5 is enabled so346* we can switch to that level.347*/348r6 = 0x3f;349sti r6;350351/* In case interrupts are disabled IPEND[4] (global interrupt disable bit)352* clear it (re-enabling interrupts again) by the special sequence of pushing353* RETI onto the stack. This way we can lower ourselves to IVG5 even if the354* exception was taken after the interrupt handler was called but before it355* got a chance to enable global interrupts itself.356*/357[--sp] = reti;358sp += 4;359360raise 5;361jump.s _bfin_return_from_exception;362ENDPROC(_ex_trap_c)363364/* We just realized we got an exception, while we were processing a different365* exception. This is a unrecoverable event, so crash.366* Note: this cannot be ENTRY() as we jump here with "if cc jump" ...367*/368ENTRY(_double_fault)369/* Turn caches & protection off, to ensure we don't get any more370* double exceptions371*/372373P4.L = LO(IMEM_CONTROL);374P4.H = HI(IMEM_CONTROL);375376R5 = [P4]; /* Control Register*/377BITCLR(R5,ENICPLB_P);378CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */379[P4] = R5;380SSYNC;381382P4.L = LO(DMEM_CONTROL);383P4.H = HI(DMEM_CONTROL);384R5 = [P4];385BITCLR(R5,ENDCPLB_P);386CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */387[P4] = R5;388SSYNC;389390/* Fix up the stack */391(R7:6,P5:4) = [sp++];392ASTAT = [sp++];393SP = EX_SCRATCH_REG;394395/* We should be out of the exception stack, and back down into396* kernel or user space stack397*/398SAVE_ALL_SYS399400/* The dumping functions expect the return address in the RETI401* slot. */402r6 = retx;403[sp + PT_PC] = r6;404405r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */406SP += -12;407pseudo_long_call _double_fault_c, p5;408SP += 12;409.L_double_fault_panic:410JUMP .L_double_fault_panic411412ENDPROC(_double_fault)413414ENTRY(_exception_to_level5)415SAVE_ALL_SYS416417GET_PDA(p5, r7); /* Fetch current PDA */418r6 = [p5 + PDA_RETX];419[sp + PT_PC] = r6;420421r6 = [p5 + PDA_SYSCFG];422[sp + PT_SYSCFG] = r6;423424r6 = [p5 + PDA_SEQSTAT]; /* Read back seqstat */425[sp + PT_SEQSTAT] = r6;426427/* Restore the hardware error vector. */428r7.h = _evt_ivhw;429r7.l = _evt_ivhw;430p4.l = lo(EVT5);431p4.h = hi(EVT5);432[p4] = r7;433csync;434435#ifdef CONFIG_DEBUG_DOUBLEFAULT436/* Now that we have the hardware error vector programmed properly437* we can re-enable interrupts (IPEND[4]), so if the _trap_c causes438* another hardware error, we can catch it (self-nesting).439*/440[--sp] = reti;441sp += 4;442#endif443444r7 = [p5 + PDA_EXIPEND] /* Read the IPEND from the Exception state */445[sp + PT_IPEND] = r7; /* Store IPEND onto the stack */446447r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */448SP += -12;449pseudo_long_call _trap_c, p4;450SP += 12;451452/* If interrupts were off during the exception (IPEND[4] = 1), turn them off453* before we return.454*/455CC = BITTST(r7, EVT_IRPTEN_P)456if !CC jump 1f;457/* this will load a random value into the reti register - but that is OK,458* since we do restore it to the correct value in the 'RESTORE_ALL_SYS' macro459*/460sp += -4;461reti = [sp++];4621:463/* restore the interrupt mask (IMASK) */464r6 = [p5 + PDA_EXIMASK];465sti r6;466467call _ret_from_exception;468RESTORE_ALL_SYS469rti;470ENDPROC(_exception_to_level5)471472ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/473/* Since the kernel stack can be anywhere, it's not guaranteed to be474* covered by a CPLB. Switch to an exception stack; use RETN as a475* scratch register (for want of a better option).476*/477EX_SCRATCH_REG = sp;478GET_PDA_SAFE(sp);479sp = [sp + PDA_EXSTACK];480/* Try to deal with syscalls quickly. */481[--sp] = ASTAT;482[--sp] = (R7:6,P5:4);483484ANOMALY_283_315_WORKAROUND(p5, r7)485486#ifdef CONFIG_EXACT_HWERR487/* Make sure all pending read/writes complete. This will ensure any488* accesses which could cause hardware errors completes, and signal489* the the hardware before we do something silly, like crash the490* kernel. We don't need to work around anomaly 05000312, since491* we are already atomic492*/493ssync;494#endif495496#ifdef CONFIG_DEBUG_DOUBLEFAULT497/*498* Save these registers, as they are only valid in exception context499* (where we are now - as soon as we defer to IRQ5, they can change)500* DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,501* but they are not very interesting, so don't save them502*/503504GET_PDA(p5, r7);505p4.l = lo(DCPLB_FAULT_ADDR);506p4.h = hi(DCPLB_FAULT_ADDR);507r7 = [p4];508[p5 + PDA_DF_DCPLB] = r7;509510p4.l = lo(ICPLB_FAULT_ADDR);511p4.h = hi(ICPLB_FAULT_ADDR);512r7 = [p4];513[p5 + PDA_DF_ICPLB] = r7;514515r7 = retx;516[p5 + PDA_DF_RETX] = r7;517518r7 = SEQSTAT; /* reason code is in bit 5:0 */519[p5 + PDA_DF_SEQSTAT] = r7;520#else521r7 = SEQSTAT; /* reason code is in bit 5:0 */522#endif523r6.l = lo(SEQSTAT_EXCAUSE);524r6.h = hi(SEQSTAT_EXCAUSE);525r7 = r7 & r6;526p5.h = _ex_table;527p5.l = _ex_table;528p4 = r7;529p5 = p5 + (p4 << 2);530p4 = [p5];531jump (p4);532533.Lbadsys:534r7 = -ENOSYS; /* signextending enough */535[sp + PT_R0] = r7; /* return value from system call */536jump .Lsyscall_really_exit;537ENDPROC(_trap)538539ENTRY(_kernel_execve)540link SIZEOF_PTREGS;541p0 = sp;542r3 = SIZEOF_PTREGS / 4;543r4 = 0(x);544.Lclear_regs:545[p0++] = r4;546r3 += -1;547cc = r3 == 0;548if !cc jump .Lclear_regs (bp);549550p0 = sp;551sp += -16;552[sp + 12] = p0;553pseudo_long_call _do_execve, p5;554SP += 16;555cc = r0 == 0;556if ! cc jump .Lexecve_failed;557/* Success. Copy our temporary pt_regs to the top of the kernel558* stack and do a normal exception return.559*/560r1 = sp;561r0 = (-KERNEL_STACK_SIZE) (x);562r1 = r1 & r0;563p2 = r1;564p3 = [p2];565r0 = KERNEL_STACK_SIZE - 4 (z);566p1 = r0;567p1 = p1 + p2;568569p0 = fp;570r4 = [p0--];571r3 = SIZEOF_PTREGS / 4;572.Lcopy_regs:573r4 = [p0--];574[p1--] = r4;575r3 += -1;576cc = r3 == 0;577if ! cc jump .Lcopy_regs (bp);578579r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);580p1 = r0;581p1 = p1 + p2;582sp = p1;583r0 = syscfg;584[SP + PT_SYSCFG] = r0;585[p3 + (TASK_THREAD + THREAD_KSP)] = sp;586587RESTORE_CONTEXT;588rti;589.Lexecve_failed:590unlink;591rts;592ENDPROC(_kernel_execve)593594ENTRY(_system_call)595/* Store IPEND */596p2.l = lo(IPEND);597p2.h = hi(IPEND);598csync;599r0 = [p2];600[sp + PT_IPEND] = r0;601602/* Store RETS for now */603r0 = rets;604[sp + PT_RESERVED] = r0;605/* Set the stack for the current process */606r7 = sp;607r6.l = lo(ALIGN_PAGE_MASK);608r6.h = hi(ALIGN_PAGE_MASK);609r7 = r7 & r6; /* thread_info */610p2 = r7;611p2 = [p2];612613[p2+(TASK_THREAD+THREAD_KSP)] = sp;614#ifdef CONFIG_IPIPE615r0 = sp;616SP += -12;617pseudo_long_call ___ipipe_syscall_root, p0;618SP += 12;619cc = r0 == 1;620if cc jump .Lsyscall_really_exit;621cc = r0 == -1;622if cc jump .Lresume_userspace;623r3 = [sp + PT_R3];624r4 = [sp + PT_R4];625p0 = [sp + PT_ORIG_P0];626#endif /* CONFIG_IPIPE */627628/* are we tracing syscalls?*/629r7 = sp;630r6.l = lo(ALIGN_PAGE_MASK);631r6.h = hi(ALIGN_PAGE_MASK);632r7 = r7 & r6;633p2 = r7;634r7 = [p2+TI_FLAGS];635CC = BITTST(r7,TIF_SYSCALL_TRACE);636if CC JUMP _sys_trace;637CC = BITTST(r7,TIF_SINGLESTEP);638if CC JUMP _sys_trace;639640/* Make sure the system call # is valid */641p4 = __NR_syscall;642/* System call number is passed in P0 */643cc = p4 <= p0;644if cc jump .Lbadsys;645646/* Execute the appropriate system call */647648p4 = p0;649p5.l = _sys_call_table;650p5.h = _sys_call_table;651p5 = p5 + (p4 << 2);652r0 = [sp + PT_R0];653r1 = [sp + PT_R1];654r2 = [sp + PT_R2];655p5 = [p5];656657[--sp] = r5;658[--sp] = r4;659[--sp] = r3;660SP += -12;661call (p5);662SP += 24;663[sp + PT_R0] = r0;664665.Lresume_userspace:666r7 = sp;667r4.l = lo(ALIGN_PAGE_MASK);668r4.h = hi(ALIGN_PAGE_MASK);669r7 = r7 & r4; /* thread_info->flags */670p5 = r7;671.Lresume_userspace_1:672/* Disable interrupts. */673[--sp] = reti;674reti = [sp++];675676r7 = [p5 + TI_FLAGS];677r4.l = lo(_TIF_WORK_MASK);678r4.h = hi(_TIF_WORK_MASK);679r7 = r7 & r4;680681.Lsyscall_resched:682#ifdef CONFIG_IPIPE683cc = BITTST(r7, TIF_IRQ_SYNC);684if !cc jump .Lsyscall_no_irqsync;685/*686* Clear IPEND[4] manually to undo what resume_userspace_1 just did;687* we need this so that high priority domain interrupts may still688* preempt the current domain while the pipeline log is being played689* back.690*/691[--sp] = reti;692SP += 4; /* don't merge with next insn to keep the pattern obvious */693SP += -12;694pseudo_long_call ___ipipe_sync_root, p4;695SP += 12;696jump .Lresume_userspace_1;697.Lsyscall_no_irqsync:698#endif699cc = BITTST(r7, TIF_NEED_RESCHED);700if !cc jump .Lsyscall_sigpending;701702/* Reenable interrupts. */703[--sp] = reti;704sp += 4;705706SP += -12;707pseudo_long_call _schedule, p4;708SP += 12;709710jump .Lresume_userspace_1;711712.Lsyscall_sigpending:713cc = BITTST(r7, TIF_RESTORE_SIGMASK);714if cc jump .Lsyscall_do_signals;715cc = BITTST(r7, TIF_SIGPENDING);716if cc jump .Lsyscall_do_signals;717cc = BITTST(r7, TIF_NOTIFY_RESUME);718if !cc jump .Lsyscall_really_exit;719.Lsyscall_do_signals:720/* Reenable interrupts. */721[--sp] = reti;722sp += 4;723724r0 = sp;725SP += -12;726pseudo_long_call _do_notify_resume, p5;727SP += 12;728729.Lsyscall_really_exit:730r5 = [sp + PT_RESERVED];731rets = r5;732rts;733ENDPROC(_system_call)734735/* Do not mark as ENTRY() to avoid error in assembler ...736* this symbol need not be global anyways, so ...737*/738_sys_trace:739r0 = sp;740pseudo_long_call _syscall_trace_enter, p5;741742/* Make sure the system call # is valid */743p4 = [SP + PT_P0];744p3 = __NR_syscall;745cc = p3 <= p4;746r0 = -ENOSYS;747if cc jump .Lsys_trace_badsys;748749/* Execute the appropriate system call */750p5.l = _sys_call_table;751p5.h = _sys_call_table;752p5 = p5 + (p4 << 2);753r0 = [sp + PT_R0];754r1 = [sp + PT_R1];755r2 = [sp + PT_R2];756r3 = [sp + PT_R3];757r4 = [sp + PT_R4];758r5 = [sp + PT_R5];759p5 = [p5];760761[--sp] = r5;762[--sp] = r4;763[--sp] = r3;764SP += -12;765call (p5);766SP += 24;767.Lsys_trace_badsys:768[sp + PT_R0] = r0;769770r0 = sp;771pseudo_long_call _syscall_trace_leave, p5;772jump .Lresume_userspace;773ENDPROC(_sys_trace)774775ENTRY(_resume)776/*777* Beware - when entering resume, prev (the current task) is778* in r0, next (the new task) is in r1.779*/780p0 = r0;781p1 = r1;782[--sp] = rets;783[--sp] = fp;784[--sp] = (r7:4, p5:3);785786/* save usp */787p2 = usp;788[p0+(TASK_THREAD+THREAD_USP)] = p2;789790/* save current kernel stack pointer */791[p0+(TASK_THREAD+THREAD_KSP)] = sp;792793/* save program counter */794r1.l = _new_old_task;795r1.h = _new_old_task;796[p0+(TASK_THREAD+THREAD_PC)] = r1;797798/* restore the kernel stack pointer */799sp = [p1+(TASK_THREAD+THREAD_KSP)];800801/* restore user stack pointer */802p0 = [p1+(TASK_THREAD+THREAD_USP)];803usp = p0;804805/* restore pc */806p0 = [p1+(TASK_THREAD+THREAD_PC)];807jump (p0);808809/*810* Following code actually lands up in a new (old) task.811*/812813_new_old_task:814(r7:4, p5:3) = [sp++];815fp = [sp++];816rets = [sp++];817818/*819* When we come out of resume, r0 carries "old" task, because we are820* in "new" task.821*/822rts;823ENDPROC(_resume)824825ENTRY(_ret_from_exception)826#ifdef CONFIG_IPIPE827p2.l = _ipipe_percpu_domain;828p2.h = _ipipe_percpu_domain;829r0.l = _ipipe_root;830r0.h = _ipipe_root;831r2 = [p2];832cc = r0 == r2;833if !cc jump 4f; /* not on behalf of the root domain, get out */834#endif /* CONFIG_IPIPE */835p2.l = lo(IPEND);836p2.h = hi(IPEND);837838csync;839r0 = [p2];840[sp + PT_IPEND] = r0;8418421:843r2 = LO(~0x37) (Z);844r0 = r2 & r0;845cc = r0 == 0;846if !cc jump 4f; /* if not return to user mode, get out */847848/* Make sure any pending system call or deferred exception849* return in ILAT for this process to get executed, otherwise850* in case context switch happens, system call of851* first process (i.e in ILAT) will be carried852* forward to the switched process853*/854855p2.l = lo(ILAT);856p2.h = hi(ILAT);857r0 = [p2];858r1 = (EVT_IVG14 | EVT_IVG15) (z);859r0 = r0 & r1;860cc = r0 == 0;861if !cc jump 5f;862863/* Set the stack for the current process */864r7 = sp;865r4.l = lo(ALIGN_PAGE_MASK);866r4.h = hi(ALIGN_PAGE_MASK);867r7 = r7 & r4; /* thread_info->flags */868p5 = r7;869r7 = [p5 + TI_FLAGS];870r4.l = lo(_TIF_WORK_MASK);871r4.h = hi(_TIF_WORK_MASK);872r7 = r7 & r4;873cc = r7 == 0;874if cc jump 4f;875876p0.l = lo(EVT15);877p0.h = hi(EVT15);878p1.l = _schedule_and_signal;879p1.h = _schedule_and_signal;880[p0] = p1;881csync;882raise 15; /* raise evt15 to do signal or reschedule */8834:884r0 = syscfg;885bitclr(r0, SYSCFG_SSSTEP_P); /* Turn off single step */886syscfg = r0;8875:888rts;889ENDPROC(_ret_from_exception)890891#if defined(CONFIG_PREEMPT)892893ENTRY(_up_to_irq14)894#if ANOMALY_05000281 || ANOMALY_05000461895r0.l = lo(SAFE_USER_INSTRUCTION);896r0.h = hi(SAFE_USER_INSTRUCTION);897reti = r0;898#endif899900#ifdef CONFIG_DEBUG_HWERR901/* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */902r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);903#else904/* Only enable irq14 interrupt, until we transition to _evt_evt14 */905r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);906#endif907sti r0;908909p0.l = lo(EVT14);910p0.h = hi(EVT14);911p1.l = _evt_up_evt14;912p1.h = _evt_up_evt14;913[p0] = p1;914csync;915916raise 14;9171:918jump 1b;919ENDPROC(_up_to_irq14)920921ENTRY(_evt_up_evt14)922#ifdef CONFIG_DEBUG_HWERR923r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);924sti r0;925#else926cli r0;927#endif928#ifdef CONFIG_TRACE_IRQFLAGS929[--sp] = rets;930sp += -12;931call _trace_hardirqs_off;932sp += 12;933rets = [sp++];934#endif935[--sp] = RETI;936SP += 4;937938/* restore normal evt14 */939p0.l = lo(EVT14);940p0.h = hi(EVT14);941p1.l = _evt_evt14;942p1.h = _evt_evt14;943[p0] = p1;944csync;945946rts;947ENDPROC(_evt_up_evt14)948949#endif950951#ifdef CONFIG_IPIPE952953_resume_kernel_from_int:954r1 = LO(~0x8000) (Z);955r1 = r0 & r1;956r0 = 1;957r0 = r1 - r0;958r2 = r1 & r0;959cc = r2 == 0;960/* Sync the root stage only from the outer interrupt level. */961if !cc jump .Lnosync;962r0.l = ___ipipe_sync_root;963r0.h = ___ipipe_sync_root;964[--sp] = reti;965[--sp] = rets;966[--sp] = ( r7:4, p5:3 );967SP += -12;968call ___ipipe_call_irqtail969SP += 12;970( r7:4, p5:3 ) = [sp++];971rets = [sp++];972reti = [sp++];973.Lnosync:974rts975#elif defined(CONFIG_PREEMPT)976977_resume_kernel_from_int:978/* check preempt_count */979r7 = sp;980r4.l = lo(ALIGN_PAGE_MASK);981r4.h = hi(ALIGN_PAGE_MASK);982r7 = r7 & r4;983p5 = r7;984r7 = [p5 + TI_PREEMPT];985cc = r7 == 0x0;986if !cc jump .Lreturn_to_kernel;987.Lneed_schedule:988r7 = [p5 + TI_FLAGS];989r4.l = lo(_TIF_WORK_MASK);990r4.h = hi(_TIF_WORK_MASK);991r7 = r7 & r4;992cc = BITTST(r7, TIF_NEED_RESCHED);993if !cc jump .Lreturn_to_kernel;994/*995* let schedule done at level 15, otherwise sheduled process will run996* at high level and block low level interrupt997*/998r6 = reti; /* save reti */999r5.l = .Lkernel_schedule;1000r5.h = .Lkernel_schedule;1001reti = r5;1002rti;1003.Lkernel_schedule:1004[--sp] = rets;1005sp += -12;1006pseudo_long_call _preempt_schedule_irq, p4;1007sp += 12;1008rets = [sp++];10091010[--sp] = rets;1011sp += -12;1012/* up to irq14 so that reti after restore_all can return to irq15(kernel) */1013pseudo_long_call _up_to_irq14, p4;1014sp += 12;1015rets = [sp++];10161017reti = r6; /* restore reti so that origin process can return to interrupted point */10181019jump .Lneed_schedule;1020#else10211022#define _resume_kernel_from_int .Lreturn_to_kernel1023#endif10241025ENTRY(_return_from_int)1026/* If someone else already raised IRQ 15, do nothing. */1027csync;1028p2.l = lo(ILAT);1029p2.h = hi(ILAT);1030r0 = [p2];1031cc = bittst (r0, EVT_IVG15_P);1032if cc jump .Lreturn_to_kernel;10331034/* if not return to user mode, get out */1035p2.l = lo(IPEND);1036p2.h = hi(IPEND);1037r0 = [p2];1038r1 = 0x17(Z);1039r2 = ~r1;1040r2.h = 0;1041r0 = r2 & r0;1042r1 = 1;1043r1 = r0 - r1;1044r2 = r0 & r1;1045cc = r2 == 0;1046if !cc jump _resume_kernel_from_int;10471048/* Lower the interrupt level to 15. */1049p0.l = lo(EVT15);1050p0.h = hi(EVT15);1051p1.l = _schedule_and_signal_from_int;1052p1.h = _schedule_and_signal_from_int;1053[p0] = p1;1054csync;1055#if ANOMALY_05000281 || ANOMALY_050004611056r0.l = lo(SAFE_USER_INSTRUCTION);1057r0.h = hi(SAFE_USER_INSTRUCTION);1058reti = r0;1059#endif1060r0 = 0x801f (z);1061STI r0;1062raise 15; /* raise evt15 to do signal or reschedule */1063rti;1064.Lreturn_to_kernel:1065rts;1066ENDPROC(_return_from_int)10671068ENTRY(_lower_to_irq14)1069#if ANOMALY_05000281 || ANOMALY_050004611070r0.l = lo(SAFE_USER_INSTRUCTION);1071r0.h = hi(SAFE_USER_INSTRUCTION);1072reti = r0;1073#endif10741075#ifdef CONFIG_DEBUG_HWERR1076/* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */1077r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);1078#else1079/* Only enable irq14 interrupt, until we transition to _evt_evt14 */1080r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);1081#endif1082sti r0;1083raise 14;1084rti;1085ENDPROC(_lower_to_irq14)10861087ENTRY(_evt_evt14)1088#ifdef CONFIG_DEBUG_HWERR1089r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);1090sti r0;1091#else1092cli r0;1093#endif1094#ifdef CONFIG_TRACE_IRQFLAGS1095[--sp] = rets;1096sp += -12;1097call _trace_hardirqs_off;1098sp += 12;1099rets = [sp++];1100#endif1101[--sp] = RETI;1102SP += 4;1103rts;1104ENDPROC(_evt_evt14)11051106ENTRY(_schedule_and_signal_from_int)1107/* To end up here, vector 15 was changed - so we have to change it1108* back.1109*/1110p0.l = lo(EVT15);1111p0.h = hi(EVT15);1112p1.l = _evt_system_call;1113p1.h = _evt_system_call;1114[p0] = p1;1115csync;11161117/* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */1118r0 = -1 (x);1119[sp + PT_ORIG_P0] = r0;11201121p1 = rets;1122[sp + PT_RESERVED] = p1;11231124#ifdef CONFIG_TRACE_IRQFLAGS1125/* trace_hardirqs_on() checks if all irqs are disabled. But here IRQ 151126* is turned on, so disable all irqs. */1127cli r0;1128sp += -12;1129call _trace_hardirqs_on;1130sp += 12;1131#endif1132#ifdef CONFIG_SMP1133GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */1134r0 = [p0 + PDA_IRQFLAGS];1135#else1136p0.l = _bfin_irq_flags;1137p0.h = _bfin_irq_flags;1138r0 = [p0];1139#endif1140sti r0;11411142/* finish the userspace "atomic" functions for it */1143r1 = FIXED_CODE_END;1144r2 = [sp + PT_PC];1145cc = r1 <= r2;1146if cc jump .Lresume_userspace (bp);11471148r0 = sp;1149sp += -12;11501151pseudo_long_call _finish_atomic_sections, p5;1152sp += 12;1153jump.s .Lresume_userspace;1154ENDPROC(_schedule_and_signal_from_int)11551156ENTRY(_schedule_and_signal)1157SAVE_CONTEXT_SYSCALL1158/* To end up here, vector 15 was changed - so we have to change it1159* back.1160*/1161p0.l = lo(EVT15);1162p0.h = hi(EVT15);1163p1.l = _evt_system_call;1164p1.h = _evt_system_call;1165[p0] = p1;1166csync;1167p0.l = 1f;1168p0.h = 1f;1169[sp + PT_RESERVED] = P0;1170call .Lresume_userspace;11711:1172RESTORE_CONTEXT1173rti;1174ENDPROC(_schedule_and_signal)11751176/* We handle this 100% in exception space - to reduce overhead1177* Only potiential problem is if the software buffer gets swapped out of the1178* CPLB table - then double fault. - so we don't let this happen in other places1179*/1180#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND1181ENTRY(_ex_trace_buff_full)1182[--sp] = P3;1183[--sp] = P2;1184[--sp] = LC0;1185[--sp] = LT0;1186[--sp] = LB0;1187P5.L = _trace_buff_offset;1188P5.H = _trace_buff_offset;1189P3 = [P5]; /* trace_buff_offset */1190P5.L = lo(TBUFSTAT);1191P5.H = hi(TBUFSTAT);1192R7 = [P5];1193R7 <<= 1; /* double, since we need to read twice */1194LC0 = R7;1195R7 <<= 2; /* need to shift over again,1196* to get the number of bytes */1197P5.L = lo(TBUF);1198P5.H = hi(TBUF);1199R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;12001201P2 = R7;1202P3 = P3 + P2;1203R7 = P3;1204R7 = R7 & R6;1205P3 = R7;1206P2.L = _trace_buff_offset;1207P2.H = _trace_buff_offset;1208[P2] = P3;12091210P2.L = _software_trace_buff;1211P2.H = _software_trace_buff;12121213LSETUP (.Lstart, .Lend) LC0;1214.Lstart:1215R7 = [P5]; /* read TBUF */1216P4 = P3 + P2;1217[P4] = R7;1218P3 += -4;1219R7 = P3;1220R7 = R7 & R6;1221.Lend:1222P3 = R7;12231224LB0 = [sp++];1225LT0 = [sp++];1226LC0 = [sp++];1227P2 = [sp++];1228P3 = [sp++];1229jump _bfin_return_from_exception;1230ENDPROC(_ex_trace_buff_full)12311232#if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 41233.data1234#else1235.section .l1.data.B1236#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */1237ENTRY(_trace_buff_offset)1238.long 0;1239ALIGN1240ENTRY(_software_trace_buff)1241.rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);1242.long 01243.endr1244#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */12451246#if CONFIG_EARLY_PRINTK1247__INIT1248ENTRY(_early_trap)1249SAVE_ALL_SYS1250trace_buffer_stop(p0,r0);12511252ANOMALY_283_315_WORKAROUND(p4, r5)12531254/* Turn caches off, to ensure we don't get double exceptions */12551256P4.L = LO(IMEM_CONTROL);1257P4.H = HI(IMEM_CONTROL);12581259R5 = [P4]; /* Control Register*/1260BITCLR(R5,ENICPLB_P);1261CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */1262[P4] = R5;1263SSYNC;12641265P4.L = LO(DMEM_CONTROL);1266P4.H = HI(DMEM_CONTROL);1267R5 = [P4];1268BITCLR(R5,ENDCPLB_P);1269CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */1270[P4] = R5;1271SSYNC;12721273r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */1274r1 = RETX;12751276SP += -12;1277call _early_trap_c;1278SP += 12;1279ENDPROC(_early_trap)1280__FINIT1281#endif /* CONFIG_EARLY_PRINTK */12821283/*1284* Put these in the kernel data section - that should always be covered by1285* a CPLB. This is needed to ensure we don't get double fault conditions1286*/12871288#ifdef CONFIG_SYSCALL_TAB_L11289.section .l1.data1290#else1291.data1292#endif12931294ENTRY(_ex_table)1295/* entry for each EXCAUSE[5:0]1296* This table must be in sync with the table in ./kernel/traps.c1297* EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined1298*/1299.long _ex_syscall /* 0x00 - User Defined - Linux Syscall */1300.long _ex_trap_c /* 0x01 - User Defined - Software breakpoint */1301#ifdef CONFIG_KGDB1302.long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection1303and break signal trap */1304#else1305.long _ex_replaceable /* 0x02 - User Defined */1306#endif1307.long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */1308.long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */1309.long _ex_replaceable /* 0x05 - User Defined */1310.long _ex_replaceable /* 0x06 - User Defined */1311.long _ex_replaceable /* 0x07 - User Defined */1312.long _ex_replaceable /* 0x08 - User Defined */1313.long _ex_replaceable /* 0x09 - User Defined */1314.long _ex_replaceable /* 0x0A - User Defined */1315.long _ex_replaceable /* 0x0B - User Defined */1316.long _ex_replaceable /* 0x0C - User Defined */1317.long _ex_replaceable /* 0x0D - User Defined */1318.long _ex_replaceable /* 0x0E - User Defined */1319.long _ex_replaceable /* 0x0F - User Defined */1320.long _ex_single_step /* 0x10 - HW Single step */1321#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND1322.long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */1323#else1324.long _ex_trap_c /* 0x11 - Trace Buffer Full */1325#endif1326.long _ex_trap_c /* 0x12 - Reserved */1327.long _ex_trap_c /* 0x13 - Reserved */1328.long _ex_trap_c /* 0x14 - Reserved */1329.long _ex_trap_c /* 0x15 - Reserved */1330.long _ex_trap_c /* 0x16 - Reserved */1331.long _ex_trap_c /* 0x17 - Reserved */1332.long _ex_trap_c /* 0x18 - Reserved */1333.long _ex_trap_c /* 0x19 - Reserved */1334.long _ex_trap_c /* 0x1A - Reserved */1335.long _ex_trap_c /* 0x1B - Reserved */1336.long _ex_trap_c /* 0x1C - Reserved */1337.long _ex_trap_c /* 0x1D - Reserved */1338.long _ex_trap_c /* 0x1E - Reserved */1339.long _ex_trap_c /* 0x1F - Reserved */1340.long _ex_trap_c /* 0x20 - Reserved */1341.long _ex_trap_c /* 0x21 - Undefined Instruction */1342.long _ex_trap_c /* 0x22 - Illegal Instruction Combination */1343.long _ex_dviol /* 0x23 - Data CPLB Protection Violation */1344.long _ex_trap_c /* 0x24 - Data access misaligned */1345.long _ex_trap_c /* 0x25 - Unrecoverable Event */1346.long _ex_dmiss /* 0x26 - Data CPLB Miss */1347.long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */1348.long _ex_trap_c /* 0x28 - Emulation Watchpoint */1349.long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */1350.long _ex_trap_c /* 0x2A - Instruction fetch misaligned */1351.long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */1352.long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */1353.long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */1354.long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */1355.long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */1356.long _ex_trap_c /* 0x2F - Reserved */1357.long _ex_trap_c /* 0x30 - Reserved */1358.long _ex_trap_c /* 0x31 - Reserved */1359.long _ex_trap_c /* 0x32 - Reserved */1360.long _ex_trap_c /* 0x33 - Reserved */1361.long _ex_trap_c /* 0x34 - Reserved */1362.long _ex_trap_c /* 0x35 - Reserved */1363.long _ex_trap_c /* 0x36 - Reserved */1364.long _ex_trap_c /* 0x37 - Reserved */1365.long _ex_trap_c /* 0x38 - Reserved */1366.long _ex_trap_c /* 0x39 - Reserved */1367.long _ex_trap_c /* 0x3A - Reserved */1368.long _ex_trap_c /* 0x3B - Reserved */1369.long _ex_trap_c /* 0x3C - Reserved */1370.long _ex_trap_c /* 0x3D - Reserved */1371.long _ex_trap_c /* 0x3E - Reserved */1372.long _ex_trap_c /* 0x3F - Reserved */1373END(_ex_table)13741375ENTRY(_sys_call_table)1376.long _sys_restart_syscall /* 0 */1377.long _sys_exit1378.long _sys_fork1379.long _sys_read1380.long _sys_write1381.long _sys_open /* 5 */1382.long _sys_close1383.long _sys_ni_syscall /* old waitpid */1384.long _sys_creat1385.long _sys_link1386.long _sys_unlink /* 10 */1387.long _sys_execve1388.long _sys_chdir1389.long _sys_time1390.long _sys_mknod1391.long _sys_chmod /* 15 */1392.long _sys_chown /* chown16 */1393.long _sys_ni_syscall /* old break syscall holder */1394.long _sys_ni_syscall /* old stat */1395.long _sys_lseek1396.long _sys_getpid /* 20 */1397.long _sys_mount1398.long _sys_ni_syscall /* old umount */1399.long _sys_setuid1400.long _sys_getuid1401.long _sys_stime /* 25 */1402.long _sys_ptrace1403.long _sys_alarm1404.long _sys_ni_syscall /* old fstat */1405.long _sys_pause1406.long _sys_ni_syscall /* old utime */ /* 30 */1407.long _sys_ni_syscall /* old stty syscall holder */1408.long _sys_ni_syscall /* old gtty syscall holder */1409.long _sys_access1410.long _sys_nice1411.long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */1412.long _sys_sync1413.long _sys_kill1414.long _sys_rename1415.long _sys_mkdir1416.long _sys_rmdir /* 40 */1417.long _sys_dup1418.long _sys_pipe1419.long _sys_times1420.long _sys_ni_syscall /* old prof syscall holder */1421.long _sys_brk /* 45 */1422.long _sys_setgid1423.long _sys_getgid1424.long _sys_ni_syscall /* old sys_signal */1425.long _sys_geteuid /* geteuid16 */1426.long _sys_getegid /* getegid16 */ /* 50 */1427.long _sys_acct1428.long _sys_umount /* recycled never used phys() */1429.long _sys_ni_syscall /* old lock syscall holder */1430.long _sys_ioctl1431.long _sys_fcntl /* 55 */1432.long _sys_ni_syscall /* old mpx syscall holder */1433.long _sys_setpgid1434.long _sys_ni_syscall /* old ulimit syscall holder */1435.long _sys_ni_syscall /* old old uname */1436.long _sys_umask /* 60 */1437.long _sys_chroot1438.long _sys_ustat1439.long _sys_dup21440.long _sys_getppid1441.long _sys_getpgrp /* 65 */1442.long _sys_setsid1443.long _sys_ni_syscall /* old sys_sigaction */1444.long _sys_sgetmask1445.long _sys_ssetmask1446.long _sys_setreuid /* setreuid16 */ /* 70 */1447.long _sys_setregid /* setregid16 */1448.long _sys_ni_syscall /* old sys_sigsuspend */1449.long _sys_ni_syscall /* old sys_sigpending */1450.long _sys_sethostname1451.long _sys_setrlimit /* 75 */1452.long _sys_ni_syscall /* old getrlimit */1453.long _sys_getrusage1454.long _sys_gettimeofday1455.long _sys_settimeofday1456.long _sys_getgroups /* getgroups16 */ /* 80 */1457.long _sys_setgroups /* setgroups16 */1458.long _sys_ni_syscall /* old_select */1459.long _sys_symlink1460.long _sys_ni_syscall /* old lstat */1461.long _sys_readlink /* 85 */1462.long _sys_uselib1463.long _sys_ni_syscall /* sys_swapon */1464.long _sys_reboot1465.long _sys_ni_syscall /* old_readdir */1466.long _sys_ni_syscall /* sys_mmap */ /* 90 */1467.long _sys_munmap1468.long _sys_truncate1469.long _sys_ftruncate1470.long _sys_fchmod1471.long _sys_fchown /* fchown16 */ /* 95 */1472.long _sys_getpriority1473.long _sys_setpriority1474.long _sys_ni_syscall /* old profil syscall holder */1475.long _sys_statfs1476.long _sys_fstatfs /* 100 */1477.long _sys_ni_syscall1478.long _sys_ni_syscall /* old sys_socketcall */1479.long _sys_syslog1480.long _sys_setitimer1481.long _sys_getitimer /* 105 */1482.long _sys_newstat1483.long _sys_newlstat1484.long _sys_newfstat1485.long _sys_ni_syscall /* old uname */1486.long _sys_ni_syscall /* iopl for i386 */ /* 110 */1487.long _sys_vhangup1488.long _sys_ni_syscall /* obsolete idle() syscall */1489.long _sys_ni_syscall /* vm86old for i386 */1490.long _sys_wait41491.long _sys_ni_syscall /* 115 */ /* sys_swapoff */1492.long _sys_sysinfo1493.long _sys_ni_syscall /* old sys_ipc */1494.long _sys_fsync1495.long _sys_ni_syscall /* old sys_sigreturn */1496.long _sys_clone /* 120 */1497.long _sys_setdomainname1498.long _sys_newuname1499.long _sys_ni_syscall /* old sys_modify_ldt */1500.long _sys_adjtimex1501.long _sys_mprotect /* 125 */1502.long _sys_ni_syscall /* old sys_sigprocmask */1503.long _sys_ni_syscall /* old "creat_module" */1504.long _sys_init_module1505.long _sys_delete_module1506.long _sys_ni_syscall /* 130: old "get_kernel_syms" */1507.long _sys_quotactl1508.long _sys_getpgid1509.long _sys_fchdir1510.long _sys_bdflush1511.long _sys_ni_syscall /* 135 */ /* sys_sysfs */1512.long _sys_personality1513.long _sys_ni_syscall /* for afs_syscall */1514.long _sys_setfsuid /* setfsuid16 */1515.long _sys_setfsgid /* setfsgid16 */1516.long _sys_llseek /* 140 */1517.long _sys_getdents1518.long _sys_ni_syscall /* sys_select */1519.long _sys_flock1520.long _sys_msync1521.long _sys_readv /* 145 */1522.long _sys_writev1523.long _sys_getsid1524.long _sys_fdatasync1525.long _sys_sysctl1526.long _sys_mlock /* 150 */1527.long _sys_munlock1528.long _sys_mlockall1529.long _sys_munlockall1530.long _sys_sched_setparam1531.long _sys_sched_getparam /* 155 */1532.long _sys_sched_setscheduler1533.long _sys_sched_getscheduler1534.long _sys_sched_yield1535.long _sys_sched_get_priority_max1536.long _sys_sched_get_priority_min /* 160 */1537.long _sys_sched_rr_get_interval1538.long _sys_nanosleep1539.long _sys_mremap1540.long _sys_setresuid /* setresuid16 */1541.long _sys_getresuid /* getresuid16 */ /* 165 */1542.long _sys_ni_syscall /* for vm86 */1543.long _sys_ni_syscall /* old "query_module" */1544.long _sys_ni_syscall /* sys_poll */1545.long _sys_nfsservctl1546.long _sys_setresgid /* setresgid16 */ /* 170 */1547.long _sys_getresgid /* getresgid16 */1548.long _sys_prctl1549.long _sys_rt_sigreturn1550.long _sys_rt_sigaction1551.long _sys_rt_sigprocmask /* 175 */1552.long _sys_rt_sigpending1553.long _sys_rt_sigtimedwait1554.long _sys_rt_sigqueueinfo1555.long _sys_rt_sigsuspend1556.long _sys_pread64 /* 180 */1557.long _sys_pwrite641558.long _sys_lchown /* lchown16 */1559.long _sys_getcwd1560.long _sys_capget1561.long _sys_capset /* 185 */1562.long _sys_sigaltstack1563.long _sys_sendfile1564.long _sys_ni_syscall /* streams1 */1565.long _sys_ni_syscall /* streams2 */1566.long _sys_vfork /* 190 */1567.long _sys_getrlimit1568.long _sys_mmap_pgoff1569.long _sys_truncate641570.long _sys_ftruncate641571.long _sys_stat64 /* 195 */1572.long _sys_lstat641573.long _sys_fstat641574.long _sys_chown1575.long _sys_getuid1576.long _sys_getgid /* 200 */1577.long _sys_geteuid1578.long _sys_getegid1579.long _sys_setreuid1580.long _sys_setregid1581.long _sys_getgroups /* 205 */1582.long _sys_setgroups1583.long _sys_fchown1584.long _sys_setresuid1585.long _sys_getresuid1586.long _sys_setresgid /* 210 */1587.long _sys_getresgid1588.long _sys_lchown1589.long _sys_setuid1590.long _sys_setgid1591.long _sys_setfsuid /* 215 */1592.long _sys_setfsgid1593.long _sys_pivot_root1594.long _sys_mincore1595.long _sys_madvise1596.long _sys_getdents64 /* 220 */1597.long _sys_fcntl641598.long _sys_ni_syscall /* reserved for TUX */1599.long _sys_ni_syscall1600.long _sys_gettid1601.long _sys_readahead /* 225 */1602.long _sys_setxattr1603.long _sys_lsetxattr1604.long _sys_fsetxattr1605.long _sys_getxattr1606.long _sys_lgetxattr /* 230 */1607.long _sys_fgetxattr1608.long _sys_listxattr1609.long _sys_llistxattr1610.long _sys_flistxattr1611.long _sys_removexattr /* 235 */1612.long _sys_lremovexattr1613.long _sys_fremovexattr1614.long _sys_tkill1615.long _sys_sendfile641616.long _sys_futex /* 240 */1617.long _sys_sched_setaffinity1618.long _sys_sched_getaffinity1619.long _sys_ni_syscall /* sys_set_thread_area */1620.long _sys_ni_syscall /* sys_get_thread_area */1621.long _sys_io_setup /* 245 */1622.long _sys_io_destroy1623.long _sys_io_getevents1624.long _sys_io_submit1625.long _sys_io_cancel1626.long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */1627.long _sys_ni_syscall /* sys_freec_hugepages */1628.long _sys_exit_group1629.long _sys_lookup_dcookie1630.long _sys_bfin_spinlock1631.long _sys_epoll_create /* 255 */1632.long _sys_epoll_ctl1633.long _sys_epoll_wait1634.long _sys_ni_syscall /* remap_file_pages */1635.long _sys_set_tid_address1636.long _sys_timer_create /* 260 */1637.long _sys_timer_settime1638.long _sys_timer_gettime1639.long _sys_timer_getoverrun1640.long _sys_timer_delete1641.long _sys_clock_settime /* 265 */1642.long _sys_clock_gettime1643.long _sys_clock_getres1644.long _sys_clock_nanosleep1645.long _sys_statfs641646.long _sys_fstatfs64 /* 270 */1647.long _sys_tgkill1648.long _sys_utimes1649.long _sys_fadvise64_641650.long _sys_ni_syscall /* vserver */1651.long _sys_mbind /* 275 */1652.long _sys_ni_syscall /* get_mempolicy */1653.long _sys_ni_syscall /* set_mempolicy */1654.long _sys_mq_open1655.long _sys_mq_unlink1656.long _sys_mq_timedsend /* 280 */1657.long _sys_mq_timedreceive1658.long _sys_mq_notify1659.long _sys_mq_getsetattr1660.long _sys_ni_syscall /* kexec_load */1661.long _sys_waitid /* 285 */1662.long _sys_add_key1663.long _sys_request_key1664.long _sys_keyctl1665.long _sys_ioprio_set1666.long _sys_ioprio_get /* 290 */1667.long _sys_inotify_init1668.long _sys_inotify_add_watch1669.long _sys_inotify_rm_watch1670.long _sys_ni_syscall /* migrate_pages */1671.long _sys_openat /* 295 */1672.long _sys_mkdirat1673.long _sys_mknodat1674.long _sys_fchownat1675.long _sys_futimesat1676.long _sys_fstatat64 /* 300 */1677.long _sys_unlinkat1678.long _sys_renameat1679.long _sys_linkat1680.long _sys_symlinkat1681.long _sys_readlinkat /* 305 */1682.long _sys_fchmodat1683.long _sys_faccessat1684.long _sys_pselect61685.long _sys_ppoll1686.long _sys_unshare /* 310 */1687.long _sys_sram_alloc1688.long _sys_sram_free1689.long _sys_dma_memcpy1690.long _sys_accept1691.long _sys_bind /* 315 */1692.long _sys_connect1693.long _sys_getpeername1694.long _sys_getsockname1695.long _sys_getsockopt1696.long _sys_listen /* 320 */1697.long _sys_recv1698.long _sys_recvfrom1699.long _sys_recvmsg1700.long _sys_send1701.long _sys_sendmsg /* 325 */1702.long _sys_sendto1703.long _sys_setsockopt1704.long _sys_shutdown1705.long _sys_socket1706.long _sys_socketpair /* 330 */1707.long _sys_semctl1708.long _sys_semget1709.long _sys_semop1710.long _sys_msgctl1711.long _sys_msgget /* 335 */1712.long _sys_msgrcv1713.long _sys_msgsnd1714.long _sys_shmat1715.long _sys_shmctl1716.long _sys_shmdt /* 340 */1717.long _sys_shmget1718.long _sys_splice1719.long _sys_sync_file_range1720.long _sys_tee1721.long _sys_vmsplice /* 345 */1722.long _sys_epoll_pwait1723.long _sys_utimensat1724.long _sys_signalfd1725.long _sys_timerfd_create1726.long _sys_eventfd /* 350 */1727.long _sys_pread641728.long _sys_pwrite641729.long _sys_fadvise641730.long _sys_set_robust_list1731.long _sys_get_robust_list /* 355 */1732.long _sys_fallocate1733.long _sys_semtimedop1734.long _sys_timerfd_settime1735.long _sys_timerfd_gettime1736.long _sys_signalfd4 /* 360 */1737.long _sys_eventfd21738.long _sys_epoll_create11739.long _sys_dup31740.long _sys_pipe21741.long _sys_inotify_init1 /* 365 */1742.long _sys_preadv1743.long _sys_pwritev1744.long _sys_rt_tgsigqueueinfo1745.long _sys_perf_event_open1746.long _sys_recvmmsg /* 370 */1747.long _sys_fanotify_init1748.long _sys_fanotify_mark1749.long _sys_prlimit641750.long _sys_cacheflush1751.long _sys_name_to_handle_at /* 375 */1752.long _sys_open_by_handle_at1753.long _sys_clock_adjtime1754.long _sys_syncfs1755.long _sys_setns1756.long _sys_sendmmsg /* 380 */17571758.rept NR_syscalls-(.-_sys_call_table)/41759.long _sys_ni_syscall1760.endr1761END(_sys_call_table)176217631764