|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2008 IBM Corporation
3: * All rights reserved.
4: * This program and the accompanying materials
5: * are made available under the terms of the BSD License
6: * which accompanies this distribution, and is available at
7: * http://www.opensource.org/licenses/bsd-license.php
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13:
14: #define LOAD64(rn,name) \
15: lis rn,name##@highest; \
16: ori rn,rn,name##@higher; \
17: rldicr rn,rn,32,31; \
18: oris rn,rn,name##@h; \
19: ori rn,rn,name##@l
20:
21: #define LOAD32(rn, name) \
22: lis rn,name##@h; \
23: ori rn,rn,name##@l
24:
25: // load 32 bit constant in little endian order
26: #define LOAD32le(rn,name) \
27: lis rn,(((name>>8)&0x00FF)|((name<<8)&0xFF00)); \
28: ori rn,rn,(((name>>24)&0x00FF)|((name>>8)&0xFF00))
29:
30: // load 16 bit constant in little endian order
31: #define LOAD16le(rn,name) \
32: li rn,(((name>>8)&0x00FF)|(name<<8))
33:
34: #define SET_CI(rn) \
35: sync; \
36: mfspr rn,LPCR; \
37: ori rn,rn,2; \
38: mtspr LPCR,rn; \
39: sync
40:
41: #define CLR_CI(rn) \
42: sync; \
43: mfspr rn,LPCR; \
44: ori rn,rn,2; \
45: xori rn,rn,2; \
46: mtspr LPCR,rn; \
47: sync
48:
49: #define SAVE_AND_SET_CI(rn,rx) \
50: sync; \
51: mfspr rx,LPCR; \
52: ori rn,rx,2; \
53: mtspr LPCR,rn; \
54: sync
55:
56: #define RESTORE_CI(rx) \
57: sync; \
58: mtspr LPCR,rx; \
59: sync
60:
61: #define ENTRY(func_name) \
62: .text; \
63: .align 2; \
64: .globl .func_name; \
65: .func_name: \
66: .globl func_name; \
67: func_name:
68:
69: #define ASM_ENTRY(fn) \
70: .globl fn; \
71: fn:
72:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.