Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / include / macros.h
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 #define LOAD64(rn,name)                 \
14         lis     rn,name##@highest;      \
15         ori     rn,rn,name##@higher;    \
16         rldicr  rn,rn,32,31;            \
17         oris    rn,rn,name##@h;         \
18         ori     rn,rn,name##@l
19
20 #define LOAD32(rn, name)                \
21         lis     rn,name##@h;            \
22         ori     rn,rn,name##@l
23
24 // load 32 bit constant in little endian order
25 #define LOAD32le(rn,name) \
26         lis     rn,(((name>>8)&0x00FF)|((name<<8)&0xFF00));  \
27         ori     rn,rn,(((name>>24)&0x00FF)|((name>>8)&0xFF00))
28
29 // load 16 bit constant in little endian order
30 #define LOAD16le(rn,name) \
31         li      rn,(((name>>8)&0x00FF)|((name<<8)&0xFF00))
32
33 #define ENTRY(func_name)              \
34         .text;                        \
35         .align  2;                    \
36         .globl  .func_name;           \
37         .func_name:                   \
38         .globl  func_name;            \
39         func_name:
40
41 #define C_ENTRY(func_name)                      \
42         .section        ".text";                \
43         .align 2;                               \
44         .globl func_name;                       \
45         .section        ".opd","aw";            \
46         .align 3;                               \
47  func_name:                                     \
48         .quad   .func_name,.TOC.@tocbase,0;     \
49         .previous;                              \
50         .size   func_name,24;                   \
51         .type   .func_name,@function;           \
52         .globl  .func_name;                     \
53  .func_name:
54
55 #define ASM_ENTRY(fn)   \
56         .globl  fn;     \
57 fn:
58