|
Last change
on this file since 2 was
2,
checked in by phkim, 11 years ago
|
|
1.phkim
- revision copy newcon3sk r27
|
-
Property svn:executable set to
*
|
|
File size:
1.7 KB
|
| Rev | Line | |
|---|
| [2] | 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2006, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | |
|---|
| 22 | #include "bcm_mips.h" |
|---|
| 23 | |
|---|
| 24 | /* global leaf function (does not call other functions) */ |
|---|
| 25 | #define LEAF(name) \ |
|---|
| 26 | .globl name; \ |
|---|
| 27 | .ent name; \ |
|---|
| 28 | name: |
|---|
| 29 | |
|---|
| 30 | /* end of a global function */ |
|---|
| 31 | #define END(name) \ |
|---|
| 32 | .size name,.-name; \ |
|---|
| 33 | .end name |
|---|
| 34 | |
|---|
| 35 | /* |
|---|
| 36 | * JPF - 32bit implementation only!!! |
|---|
| 37 | */ |
|---|
| 38 | |
|---|
| 39 | /* |
|---|
| 40 | * int setjmp(char *jmp_buf) |
|---|
| 41 | * |
|---|
| 42 | * a0 jmp_buf (44 bytes) |
|---|
| 43 | */ |
|---|
| 44 | LEAF(setjmp) |
|---|
| 45 | |
|---|
| 46 | sw s0, 0(a0) |
|---|
| 47 | sw s1, 4(a0) |
|---|
| 48 | sw s2, 8(a0) |
|---|
| 49 | sw s3, 12(a0) |
|---|
| 50 | sw s4, 16(a0) |
|---|
| 51 | sw s5, 20(a0) |
|---|
| 52 | sw s6, 24(a0) |
|---|
| 53 | sw s7, 28(a0) |
|---|
| 54 | sw s8, 32(a0) |
|---|
| 55 | |
|---|
| 56 | sw sp, 36(a0) |
|---|
| 57 | sw ra, 40(a0) |
|---|
| 58 | |
|---|
| 59 | move v0,zero |
|---|
| 60 | |
|---|
| 61 | j ra |
|---|
| 62 | nop |
|---|
| 63 | |
|---|
| 64 | END(setjmp) |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | /* |
|---|
| 68 | * int longjmp(char *jmp_buf,int val) |
|---|
| 69 | * |
|---|
| 70 | * a0 jmp_buf (44 bytes initialized by setjmp) |
|---|
| 71 | * a1 val return value after initiating longjmp |
|---|
| 72 | */ |
|---|
| 73 | LEAF(longjmp) |
|---|
| 74 | |
|---|
| 75 | lw s0, 0(a0) |
|---|
| 76 | lw s1, 4(a0) |
|---|
| 77 | lw s2, 8(a0) |
|---|
| 78 | lw s3, 12(a0) |
|---|
| 79 | lw s4, 16(a0) |
|---|
| 80 | lw s5, 20(a0) |
|---|
| 81 | lw s6, 24(a0) |
|---|
| 82 | lw s7, 28(a0) |
|---|
| 83 | lw s8, 32(a0) |
|---|
| 84 | |
|---|
| 85 | lw sp, 36(a0) |
|---|
| 86 | lw ra, 40(a0) |
|---|
| 87 | |
|---|
| 88 | /* if val is 0 return a 1, otherwise return val */ |
|---|
| 89 | bne a1, zero, 1f |
|---|
| 90 | li v0, 1 |
|---|
| 91 | 1: |
|---|
| 92 | move v0, a1 |
|---|
| 93 | |
|---|
| 94 | j ra |
|---|
| 95 | nop |
|---|
| 96 | |
|---|
| 97 | END(longjmp) |
|---|
| 98 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.