Qore Programming Language
1.12.0
macros-ia64.h
1
/* -*- mode: c++; indent-tabs-mode: nil -*- */
2
/*
3
macros-itanium.h
4
5
assembly macros for the Itanium (IA-64) architecture
6
7
Qore Programming Language
8
9
Copyright (C) 2003 - 2022 David Nichols
10
11
Permission is hereby granted, free of charge, to any person obtaining a
12
copy of this software and associated documentation files (the "Software"),
13
to deal in the Software without restriction, including without limitation
14
the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
and/or sell copies of the Software, and to permit persons to whom the
16
Software is furnished to do so, subject to the following conditions:
17
18
The above copyright notice and this permission notice shall be included in
19
all copies or substantial portions of the Software.
20
21
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
DEALINGS IN THE SOFTWARE.
28
29
Note that the Qore library is released under a choice of three open-source
30
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
31
information.
32
*/
33
34
#ifndef _QORE_MACHINE_MACROS_H
35
#define _QORE_MACHINE_MACROS_H
36
37
//#pragma message "using macros-ia64.h"
38
39
#define STACK_DIRECTION_DOWN 1
40
41
#ifdef __GNUC__
42
#ifdef __LP64__
43
44
#define HAVE_CHECK_STACK_POS
45
46
static
inline
size_t
get_stack_pos() {
47
size_t
addr;
48
asm
volatile
(
"mov %0=sp"
:
"=r"
(addr));
49
return
addr;
50
}
51
52
static
inline
size_t
get_rse_bsp() {
53
size_t
addr;
54
asm
volatile
(
"mov %0=ar.bsp"
:
"=r"
(addr));
55
return
addr;
56
}
57
58
#endif
// #ifdef __LP64__
59
#endif
// #ifdef __GNUC__
60
61
#ifdef __HP_aCC
62
#ifdef __LP64__
63
64
#define HAVE_CHECK_STACK_POS
65
66
extern
"C"
size_t
get_stack_pos();
67
extern
"C"
size_t
get_rse_bsp();
// get ia64 Register Stack Engine backing store pointer
68
69
#endif
// #ifdef __LP64__
70
#endif
// #ifdef __HP_aCC
71
72
#endif
// #ifndef _QORE_MACHINE_MACROS_H
73