2011-04-27 23:42:16 +02:00
|
|
|
/* $NetBSD: cdefs_aout.h,v 1.20 2006/05/18 17:55:38 christos Exp $ */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Written by J.T. Conklin <jtc@wimsey.com> 01/17/95.
|
|
|
|
* Public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SYS_CDEFS_AOUT_H_
|
|
|
|
#define _SYS_CDEFS_AOUT_H_
|
|
|
|
|
|
|
|
#define _C_LABEL(x) __CONCAT(_,x)
|
|
|
|
#define _C_LABEL_STRING(x) "_"x
|
|
|
|
|
Add Socket Libraries.
Add Posix functions for porting compatibility.
Fix compliance issues with ISO/IEC 9899:199409
New Functions:
setenv(), fparseln(), GetFileNameFromPath(), rename(),
realpath(), setprogname(), getprogname(), strlcat(), strlcpy(),
strsep(), setitimer(), getitimer(), timegm(), getopt(), basename(),
mkstemp(), ffs(), vsnprintf(), snprintf(), getpass(), usleep(), select(),
writev(), strcasecmp(), getcwd(), chdir(), tcgetpgrp(), getpgrp(), gettimeofday(),
bcopy(),
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12061 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-30 02:30:44 +02:00
|
|
|
#define ___RENAME(x)
|
2011-04-27 23:42:16 +02:00
|
|
|
|
|
|
|
#define __indr_reference(sym,alias) /* nada, since we do weak refs */
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#if __STDC__
|
2011-09-16 22:59:10 +02:00
|
|
|
#ifndef DONT_USE_STRONG_WEAK_ALIAS
|
|
|
|
#define __strong_alias(alias,sym) \
|
|
|
|
__asm(".global " _C_LABEL_STRING(#alias) "\n" \
|
|
|
|
_C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
|
|
|
|
#define __weak_alias(alias,sym) \
|
|
|
|
__asm(".weak " _C_LABEL_STRING(#alias) "\n" \
|
|
|
|
_C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
|
2011-04-27 23:42:16 +02:00
|
|
|
|
2011-09-16 22:59:10 +02:00
|
|
|
/* Do not use __weak_extern, use __weak_reference instead */
|
|
|
|
#define __weak_extern(sym) \
|
|
|
|
__asm(".weak " _C_LABEL_STRING(#sym));
|
2011-04-27 23:42:16 +02:00
|
|
|
|
2011-09-16 22:59:10 +02:00
|
|
|
#if __GNUC_PREREQ__(4, 0)
|
|
|
|
#define __weak_reference(sym) __attribute__((__weakref__))
|
2011-04-27 23:42:16 +02:00
|
|
|
#else
|
2011-09-16 22:59:10 +02:00
|
|
|
#define __weak_reference(sym) ; __asm(".weak " _C_LABEL_STRING(#sym))
|
|
|
|
#endif
|
2011-04-27 23:42:16 +02:00
|
|
|
|
2011-09-16 22:59:10 +02:00
|
|
|
#define __warn_references(sym,msg) \
|
|
|
|
__asm(".stabs \"" msg "\",30,0,0,0"); \
|
|
|
|
__asm(".stabs \"_" #sym "\",1,0,0,0");
|
|
|
|
#else
|
|
|
|
#define __strong_alias(alias,sym) /* NOTHING */
|
|
|
|
#define __weak_alias(alias,sym) /* NOTHING */
|
|
|
|
#define __weak_extern(sym) /* NOTHING */
|
|
|
|
#define __weak_reference(sym) /* NOTHING */
|
|
|
|
|
2014-09-09 23:59:08 +02:00
|
|
|
#if defined(__CC_ARM) || defined(__APPLE__)
|
2011-09-16 22:59:10 +02:00
|
|
|
#define __warn_references(sym,msg)
|
2014-09-09 23:59:08 +02:00
|
|
|
#else
|
|
|
|
#define __warn_references(sym,msg) \
|
|
|
|
__asm(".stabs \"" msg "\",30,0,0,0"); \
|
|
|
|
__asm(".stabs \"_" #sym "\",1,0,0,0");
|
2011-04-27 23:42:16 +02:00
|
|
|
#endif
|
2011-09-16 22:59:10 +02:00
|
|
|
#endif
|
|
|
|
#else /* __STDC__ */
|
|
|
|
#define __weak_alias(alias,sym) ___weak_alias(_/**/alias,_/**/sym)
|
|
|
|
#define ___weak_alias(alias,sym) \
|
|
|
|
__asm(".weak alias\nalias = sym");
|
|
|
|
/* Do not use __weak_extern, use __weak_reference instead */
|
|
|
|
#define __weak_extern(sym) ___weak_extern(_/**/sym)
|
|
|
|
#define ___weak_extern(sym) \
|
|
|
|
__asm(".weak sym");
|
2011-04-27 23:42:16 +02:00
|
|
|
|
2011-09-16 22:59:10 +02:00
|
|
|
#if __GNUC_PREREQ__(4, 0)
|
|
|
|
#define __weak_reference(sym) __attribute__((__weakref__))
|
|
|
|
#else
|
|
|
|
#define ___weak_reference(sym) ; __asm(".weak sym");
|
|
|
|
#define __weak_reference(sym) ___weak_reference(_/**/sym)
|
|
|
|
#endif
|
2011-04-27 23:42:16 +02:00
|
|
|
|
2011-09-16 22:59:10 +02:00
|
|
|
#define __warn_references(sym,msg) \
|
|
|
|
__asm(".stabs msg,30,0,0,0"); \
|
|
|
|
__asm(".stabs \"_/**/sym\",1,0,0,0");
|
2011-04-27 23:42:16 +02:00
|
|
|
#endif /* __STDC__ */
|
|
|
|
#else /* __GNUC__ */
|
2011-09-16 22:59:10 +02:00
|
|
|
#define __warn_references(sym,msg)
|
2011-04-27 23:42:16 +02:00
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
|
|
|
#if defined(__sh__) /* XXX SH COFF */
|
|
|
|
#undef __indr_reference(sym,alias)
|
|
|
|
#undef __warn_references(sym,msg)
|
|
|
|
#define __warn_references(sym,msg)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __IDSTRING(_n,_s) \
|
|
|
|
__asm(".data ; .asciz \"" _s "\" ; .text")
|
|
|
|
|
|
|
|
#undef __KERNEL_RCSID
|
|
|
|
|
2011-06-28 04:34:10 +02:00
|
|
|
//#define __RCSID(_s) __IDSTRING(rcsid,_s)
|
|
|
|
#define __RCSID(_s)
|
2011-04-27 23:42:16 +02:00
|
|
|
#define __SCCSID(_s)
|
|
|
|
#define __SCCSID2(_s)
|
|
|
|
#if 0 /* XXX userland __COPYRIGHTs have \ns in them */
|
|
|
|
#define __COPYRIGHT(_s) __IDSTRING(copyright,_s)
|
|
|
|
#else
|
|
|
|
#define __COPYRIGHT(_s) \
|
|
|
|
static const char copyright[] __attribute__((__unused__)) = _s
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(USE_KERNEL_RCSIDS) || !defined(_KERNEL)
|
|
|
|
#define __KERNEL_RCSID(_n,_s) __IDSTRING(__CONCAT(rcsid,_n),_s)
|
|
|
|
#else
|
|
|
|
#define __KERNEL_RCSID(_n,_s)
|
|
|
|
#endif
|
|
|
|
#define __KERNEL_SCCSID(_n,_s)
|
|
|
|
#define __KERNEL_COPYRIGHT(_n, _s) __IDSTRING(__CONCAT(copyright,_n),_s)
|
|
|
|
|
|
|
|
#ifndef __lint__
|
|
|
|
#define __link_set_make_entry(set, sym, type) \
|
|
|
|
static void const * const \
|
|
|
|
__link_set_##set##_sym_##sym __used = &sym; \
|
|
|
|
__asm(".stabs \"___link_set_" #set "\", " #type ", 0, 0, _" #sym)
|
|
|
|
#else
|
|
|
|
#define __link_set_make_entry(set, sym, type) \
|
|
|
|
extern void const * const __link_set_##set##_sym_##sym
|
|
|
|
#endif /* __lint__ */
|
|
|
|
|
|
|
|
#define __link_set_add_text(set, sym) __link_set_make_entry(set, sym, 23)
|
|
|
|
#define __link_set_add_rodata(set, sym) __link_set_make_entry(set, sym, 23)
|
|
|
|
#define __link_set_add_data(set, sym) __link_set_make_entry(set, sym, 25)
|
|
|
|
#define __link_set_add_bss(set, sym) __link_set_make_entry(set, sym, 27)
|
|
|
|
|
|
|
|
#define __link_set_decl(set, ptype) \
|
|
|
|
extern struct { \
|
|
|
|
int __ls_length; \
|
|
|
|
ptype *__ls_items[1]; \
|
|
|
|
} __link_set_##set
|
|
|
|
|
|
|
|
#define __link_set_start(set) (&(__link_set_##set).__ls_items[0])
|
|
|
|
#define __link_set_end(set) \
|
|
|
|
(&(__link_set_##set).__ls_items[(__link_set_##set).__ls_length])
|
|
|
|
|
|
|
|
#define __link_set_count(set) ((__link_set_##set).__ls_length)
|
|
|
|
|
|
|
|
#endif /* !_SYS_CDEFS_AOUT_H_ */
|