entry.S (074fa7e76cfff4cd1a60753ee4596510f1b87183) | entry.S (c2219eda547813c0c50dba90d9e989ae36cc3ab8) |
---|---|
1/* 2 * Low-level system-call handling, trap handlers and context-switching 3 * 4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu> 5 * Copyright (C) 2008-2009 PetaLogix 6 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au> 7 * Copyright (C) 2001,2002 NEC Corporation 8 * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org> --- 334 unchanged lines hidden (view full) --- 343 lwi r9, r1, PT_R9; 344 lwi r10, r1, PT_R10; 3454: 346/* Jump to the appropriate function for the system call number in r12 347 * (r12 is not preserved), or return an error if r12 is not valid. 348 * The LP register should point to the location where the called function 349 * should return. [note that MAKE_SYS_CALL uses label 1] */ 350 /* See if the system call number is valid */ | 1/* 2 * Low-level system-call handling, trap handlers and context-switching 3 * 4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu> 5 * Copyright (C) 2008-2009 PetaLogix 6 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au> 7 * Copyright (C) 2001,2002 NEC Corporation 8 * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org> --- 334 unchanged lines hidden (view full) --- 343 lwi r9, r1, PT_R9; 344 lwi r10, r1, PT_R10; 3454: 346/* Jump to the appropriate function for the system call number in r12 347 * (r12 is not preserved), or return an error if r12 is not valid. 348 * The LP register should point to the location where the called function 349 * should return. [note that MAKE_SYS_CALL uses label 1] */ 350 /* See if the system call number is valid */ |
351 blti r12, 5f |
|
351 addi r11, r12, -__NR_syscalls; 352 bgei r11, 5f; 353 /* Figure out which function to use for this system call. */ 354 /* Note Microblaze barrel shift is optional, so don't rely on it */ 355 add r12, r12, r12; /* convert num -> ptr */ 356 add r12, r12, r12; 357 addi r30, r0, 1 /* restarts allowed */ 358 --- 11 unchanged lines hidden (view full) --- 370 # Find and jump into the syscall handler. 371 lwi r12, r12, sys_call_table 372 /* where the trap should return need -8 to adjust for rtsd r15, 8 */ 373 addi r15, r0, ret_from_trap-8 374 bra r12 375 376 /* The syscall number is invalid, return an error. */ 3775: | 352 addi r11, r12, -__NR_syscalls; 353 bgei r11, 5f; 354 /* Figure out which function to use for this system call. */ 355 /* Note Microblaze barrel shift is optional, so don't rely on it */ 356 add r12, r12, r12; /* convert num -> ptr */ 357 add r12, r12, r12; 358 addi r30, r0, 1 /* restarts allowed */ 359 --- 11 unchanged lines hidden (view full) --- 371 # Find and jump into the syscall handler. 372 lwi r12, r12, sys_call_table 373 /* where the trap should return need -8 to adjust for rtsd r15, 8 */ 374 addi r15, r0, ret_from_trap-8 375 bra r12 376 377 /* The syscall number is invalid, return an error. */ 3785: |
378 rtsd r15, 8; /* looks like a normal subroutine return */ | 379 braid ret_from_trap |
379 addi r3, r0, -ENOSYS; 380 381/* Entry point used to return from a syscall/trap */ 382/* We re-enable BIP bit before state restore */ 383C_ENTRY(ret_from_trap): 384 swi r3, r1, PT_R3 385 swi r4, r1, PT_R4 386 --- 618 unchanged lines hidden --- | 380 addi r3, r0, -ENOSYS; 381 382/* Entry point used to return from a syscall/trap */ 383/* We re-enable BIP bit before state restore */ 384C_ENTRY(ret_from_trap): 385 swi r3, r1, PT_R3 386 swi r4, r1, PT_R4 387 --- 618 unchanged lines hidden --- |