blob: 4877050ba42c550d069e7238d095baf919f89776 [file] [log] [blame]
wdenk327f7a02001-11-28 17:49:55 +00001/**************************************
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
29load_runtime_reg:
30
31 xor r5,r5,r5
wdenk8bde7f72003-06-27 21:31:46 +000032 or r5,r5,r3 /* save eumbbar */
wdenk327f7a02001-11-28 17:49:55 +000033
34 lwbrx r3,r4,r5
35 sync
36
wdenk8bde7f72003-06-27 21:31:46 +000037 bclr 20, 0
wdenk327f7a02001-11-28 17:49:55 +000038
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 ****************************************************************/
wdenk8bde7f72003-06-27 21:31:46 +000047 .text
48 .align 2
49 .global store_runtime_reg
wdenk327f7a02001-11-28 17:49:55 +000050store_runtime_reg:
51
52 xor r0,r0,r0
53
54 stwbrx r5, r4, r3
55 sync
56
57 bclr 20,0