1 /* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 #include <sysdeps/unix/powerpc/sysdep.h>
22 /* This seems to always be the case on PPC. */
23 #define ALIGNARG(log2) log2
25 /* How to define local lables. */
26 #define L(name) L..##name
28 /* Label in text section. */
29 #define C_TEXT(name) .##name
31 /* Function descriptor. */
32 #define FUNCDESC(real, code) \
34 .csect real##[DS], 3; \
37 .long code, TOC[tc0], 0;
39 /* Code to generate function entry code. */
41 FUNCDESC (name, C_TEXT (name)) \
42 .csect .text[PR], 2; \
43 .globl C_TEXT (name); \
46 /* XXX For now we don't define any code. */
49 #define EALIGN_W_0 /* No words to insert. */
50 #define EALIGN_W_1 nop
51 #define EALIGN_W_2 nop;nop
52 #define EALIGN_W_3 nop;nop;nop
53 #define EALIGN_W_4 EALIGN_W_3;nop
54 #define EALIGN_W_5 EALIGN_W_4;nop
55 #define EALIGN_W_6 EALIGN_W_5;nop
56 #define EALIGN_W_7 EALIGN_W_6;nop
58 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
59 past a 2^align boundary. */
61 #define EALIGN(name, alignt, words) \
62 FUNCDESC (name, C_TEXT (name)) \
63 .csect .text[PR], 2; \
65 .globl C_TEXT (name); \
69 .align ALIGNARG(alignt); \
73 #define EALIGN(name, alignt, words) \
74 FUNCDESC (name, C_TEXT (name)) \
75 .csect .text[PR], 2; \
76 .align ALIGNARG(alignt); \
78 .globl C_TEXT (name); \
82 /* No special end code for now. We will eventually add to usual prolog
83 with function length etc. */
87 /* Jumping to another function. We are jumping to the TOC entry. */
88 #define JUMPTARGET(name) C_TEXT (name)