wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 1 | /************************************** |
| 2 | * |
| 3 | * copyright @ Motorola, 1999 |
| 4 | * |
| 5 | * |
| 6 | * This file contains two commonly used |
| 7 | * lower level utility routines. |
| 8 | * |
| 9 | * The utility routines are also in other |
| 10 | * Kahlua device driver libraries. The |
| 11 | * need to be linked in only once. |
| 12 | **************************************/ |
| 13 | |
| 14 | #include <ppc_asm.tmpl> |
| 15 | #include <ppc_defs.h> |
| 16 | |
| 17 | /********************************************************** |
| 18 | * function: load_runtime_reg |
| 19 | * |
| 20 | * input: r3 - value of eumbbar |
| 21 | * r4 - register offset in embedded utility space |
| 22 | * |
| 23 | * output: r3 - register content |
| 24 | **********************************************************/ |
| 25 | .text |
| 26 | .align 2 |
| 27 | .global load_runtime_reg |
| 28 | |
| 29 | load_runtime_reg: |
| 30 | |
| 31 | xor r5,r5,r5 |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame^] | 32 | or r5,r5,r3 /* save eumbbar */ |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 33 | |
| 34 | lwbrx r3,r4,r5 |
| 35 | sync |
| 36 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame^] | 37 | bclr 20, 0 |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 38 | |
| 39 | /**************************************************************** |
| 40 | * function: store_runtime_reg |
| 41 | * |
| 42 | * input: r3 - value of eumbbar |
| 43 | * r4 - register offset in embedded utility space |
| 44 | * r5 - new value to be stored |
| 45 | * |
| 46 | ****************************************************************/ |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame^] | 47 | .text |
| 48 | .align 2 |
| 49 | .global store_runtime_reg |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 50 | store_runtime_reg: |
| 51 | |
| 52 | xor r0,r0,r0 |
| 53 | |
| 54 | stwbrx r5, r4, r3 |
| 55 | sync |
| 56 | |
| 57 | bclr 20,0 |