Subversion Repositories Kolibri OS

Rev

Rev 1905 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1905 Rev 3960
1
/*
1
/*
2
	mangle: support defines for preprocessed assembler
2
	mangle: support defines for preprocessed assembler
3
 
3
 
4
	copyright 1995-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
4
	copyright 1995-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
5
	see COPYING and AUTHORS files in distribution or http://mpg123.org
5
	see COPYING and AUTHORS files in distribution or http://mpg123.org
6
 
6
 
7
	This once started out as mangle.h from MPlayer, but you can't really call it derived work... the small part that in principle stems from MPlayer also being not very special (once you decided to use such a header at all, it's quite obvious material).
7
	This once started out as mangle.h from MPlayer, but you can't really call it derived work... the small part that in principle stems from MPlayer also being not very special (once you decided to use such a header at all, it's quite obvious material).
8
*/
8
*/
9
 
9
 
10
#ifndef __MANGLE_H
10
#ifndef __MANGLE_H
11
#define __MANGLE_H
11
#define __MANGLE_H
12
 
12
 
13
#include "config.h"
13
#include "config.h"
-
 
14
#include "intsym.h"
14
 
15
 
15
#ifdef CCALIGN
16
#ifdef CCALIGN
16
#define MOVUAPS movaps
17
#define MOVUAPS movaps
17
#else
18
#else
18
#define MOVUAPS movups
19
#define MOVUAPS movups
19
#endif
20
#endif
-
 
21
 
-
 
22
/*
-
 
23
	ALIGNX: align to X bytes
-
 
24
	This differs per compiler/platform in taking the byte count or an exponent for base 2.
-
 
25
	A way out is balign, if the assembler supports it (gas extension).
-
 
26
*/
-
 
27
 
-
 
28
#ifdef ASMALIGN_BALIGN
-
 
29
 
-
 
30
#define ALIGN4  .balign 4
-
 
31
#define ALIGN8  .balign 8
-
 
32
#define ALIGN16 .balign 16
-
 
33
#define ALIGN32 .balign 32
-
 
34
 
-
 
35
#else
20
 
36
 
21
#ifdef ASMALIGN_EXP
37
#ifdef ASMALIGN_EXP
22
#define ALIGN4  .align 2
38
#define ALIGN4  .align 2
23
#define ALIGN8  .align 3
39
#define ALIGN8  .align 3
24
#define ALIGN16 .align 4
40
#define ALIGN16 .align 4
25
#define ALIGN32 .align 5
41
#define ALIGN32 .align 5
26
#else
42
#else
-
 
43
#ifdef ASMALIGN_BYTE
27
#define ALIGN4  .align 4
44
#define ALIGN4  .align 4
28
#define ALIGN8  .align 8
45
#define ALIGN8  .align 8
29
#define ALIGN16 .align 16
46
#define ALIGN16 .align 16
30
#define ALIGN32 .align 32
47
#define ALIGN32 .align 32
-
 
48
#else
-
 
49
#error "Dunno how assembler alignment works. Please specify."
-
 
50
#endif
31
#endif
51
#endif
-
 
52
 
-
 
53
#endif
-
 
54
 
-
 
55
#define MANGLE_MACROCAT_REALLY(a, b) a ## b
32
 
56
#define MANGLE_MACROCAT(a, b) MANGLE_MACROCAT_REALLY(a, b)
-
 
57
/* Feel free to add more to the list, eg. a.out IMO */
-
 
58
#if defined(__USER_LABEL_PREFIX__)
-
 
59
#define ASM_NAME(a) MANGLE_MACROCAT(__USER_LABEL_PREFIX__,a)
33
/* Feel free to add more to the list, eg. a.out IMO */
60
#define ASM_VALUE(a) MANGLE_MACROCAT($,ASM_NAME(a))
34
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || defined(_MSC_VER) || \
61
#elif defined(__CYGWIN__) || defined(_WIN32) && !defined (_WIN64) || defined(__OS2__) || \
35
   (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
62
   (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
36
#define ASM_NAME(a) _##a
63
#define ASM_NAME(a) MANGLE_MACROCAT(_,a)
37
#define ASM_VALUE(a) $_##a
64
#define ASM_VALUE(a) MANGLE_MACROCAT($_,a)
38
#else
65
#else
39
#define ASM_NAME(a) a
66
#define ASM_NAME(a) a
40
#define ASM_VALUE(a) $##a
67
#define ASM_VALUE(a) MANGLE_MACROCAT($,a)
41
#endif
68
#endif
42
 
69
 
43
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
70
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
44
#define COMM(a,b,c) .comm a,b
71
#define COMM(a,b,c) .comm a,b
45
#else
72
#else
46
#define COMM(a,b,c) .comm a,b,c
73
#define COMM(a,b,c) .comm a,b,c
47
#endif
74
#endif
48
/* more hacks for macosx; no .bss ... */
75
/* more hacks for macosx; no .bss ... */
49
#ifdef __APPLE__
76
#ifdef __APPLE__
50
#define BSS .data
77
#define BSS .data
51
#else
78
#else
52
#define BSS .bss
79
#define BSS .bss
53
#endif
80
#endif
-
 
81
 
-
 
82
/* Mark non-executable stack.
-
 
83
   It's mainly for GNU on Linux... who else does (not) like this? */
-
 
84
#if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__)
-
 
85
#define NONEXEC_STACK .section .note.GNU-stack,"",%progbits
-
 
86
#else
-
 
87
#define NONEXEC_STACK
-
 
88
#endif
-
 
89
 
54
#endif /* !__MANGLE_H */
90
#endif /* !__MANGLE_H */