Deleted Added
full compact
asmacros.h (22636) asmacros.h (22808)
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/i386/include/asmacros.h 22636 1997-02-13 08:31:53Z bde $
33 * $FreeBSD: head/sys/i386/include/asmacros.h 22808 1997-02-16 18:26:31Z bde $
34 */
35
36#ifndef _MACHINE_ASMACROS_H_
37#define _MACHINE_ASMACROS_H_
38
39#ifdef KERNEL
40#include <sys/cdefs.h>
41

--- 80 unchanged lines hidden (view full) ---

122#define MCOUNT_LABEL(name)
123#define MEXITCOUNT
124#endif /* GPROF */
125
126#else /* !KERNEL */
127
128#include "/usr/src/lib/libc/i386/DEFS.h" /* XXX blech */
129
34 */
35
36#ifndef _MACHINE_ASMACROS_H_
37#define _MACHINE_ASMACROS_H_
38
39#ifdef KERNEL
40#include <sys/cdefs.h>
41

--- 80 unchanged lines hidden (view full) ---

122#define MCOUNT_LABEL(name)
123#define MEXITCOUNT
124#endif /* GPROF */
125
126#else /* !KERNEL */
127
128#include "/usr/src/lib/libc/i386/DEFS.h" /* XXX blech */
129
130/*
131 * In the !KERNEL case, this header is only (ab)used in lib/msun/i387.
132 * Use it to generate code to select between the generic math functions
133 * and the i387 ones.
134 */
135#undef ENTRY
136#define ANAME(x) CNAME(__CONCAT(__i387_,x))
137#define ASELNAME(x) CNAME(__CONCAT(__arch_select_,x))
138#define AVECNAME(x) CNAME(__CONCAT(__arch_,x))
139#define GNAME(x) CNAME(__CONCAT(__generic_,x))
140
141/* Don't bother profiling this. */
142#ifdef PIC
143#define ARCH_DISPATCH(x) \
144 START_ENTRY; \
145 .globl CNAME(x); .type CNAME(x),@function; CNAME(x): ; \
146 PIC_PROLOGUE; \
147 movl PIC_GOT(AVECNAME(x)),%eax; \
148 PIC_EPILOGUE; \
149 jmpl *(%eax)
150
151#define ARCH_SELECT(x) START_ENTRY; \
152 .type ASELNAME(x),@function; \
153 ASELNAME(x): \
154 PIC_PROLOGUE; \
155 call PIC_PLT(CNAME(__get_hw_float)); \
156 testl %eax,%eax; \
157 movl PIC_GOT(ANAME(x)),%eax; \
158 jne 8f; \
159 movl PIC_GOT(GNAME(x)),%eax; \
160 8: \
161 movl PIC_GOT(AVECNAME(x)),%edx; \
162 movl %eax,(%edx); \
163 PIC_EPILOGUE; \
164 jmpl *%eax
165#else /* !PIC */
166#define ARCH_DISPATCH(x) \
167 START_ENTRY; \
168 .globl CNAME(x); .type CNAME(x),@function; CNAME(x): ; \
169 jmpl *AVECNAME(x)
170
171#define ARCH_SELECT(x) START_ENTRY; \
172 .type ASELNAME(x),@function; \
173 ASELNAME(x): \
174 call CNAME(__get_hw_float); \
175 testl %eax,%eax; \
176 movl $ANAME(x),%eax; \
177 jne 8f; \
178 movl $GNAME(x),%eax; \
179 8: \
180 movl %eax,AVECNAME(x); \
181 jmpl *%eax
182#endif /* PIC */
183
184#define ARCH_VECTOR(x) .data; .align 2; \
185 .globl AVECNAME(x); \
186 .type AVECNAME(x),@object; \
187 .size AVECNAME(x),4; \
188 AVECNAME(x): .long ASELNAME(x)
189
190#ifdef PROF
191
192#define ALTENTRY(x) ENTRY(x); jmp 9f
193#define ENTRY(x) ARCH_VECTOR(x); ARCH_SELECT(x); ARCH_DISPATCH(x); \
194 START_ENTRY; \
195 .globl ANAME(x); .type ANAME(x),@function; ANAME(x):; \
196 call HIDENAME(mcount); 9:
197
198#else /* !PROF */
199
200#define ALTENTRY(x) ENTRY(x)
201#define ENTRY(x) ARCH_VECTOR(x); ARCH_SELECT(x); ARCH_DISPATCH(x); \
202 START_ENTRY; \
203 .globl ANAME(x); .type ANAME(x),@function; ANAME(x):
204
205#endif /* PROF */
206
130#ifndef RCSID
131#define RCSID(a)
132#endif
133
134#endif /* KERNEL */
135
136#endif /* !_MACHINE_ASMACROS_H_ */
207#ifndef RCSID
208#define RCSID(a)
209#endif
210
211#endif /* KERNEL */
212
213#endif /* !_MACHINE_ASMACROS_H_ */