Skip to content

Commit

Permalink
Add macros to support MACH-0 systems on arm64.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Jan 18, 2021
1 parent a795e78 commit 7c5a3eb
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifdef LEADING_UNDERSCORE

#define GLOBAL_FUNCTION(name) \
.globl _##name; \
.type _##name, %function; \
_##name

#define LOCAL_FUNCTION(name) \
.type _##name, %function; \
_##name

#define GLOBAL_VARIABLE(name, size_) \
.global _##name; \
.type _##name, %object; \
.size _##name, size_

#else

#define GLOBAL_FUNCTION(name) \
.globl name; \
.hidden name; \
Expand All @@ -35,6 +53,8 @@
.type name, %object; \
.size name, size_

#endif

.macro movl Wn, imm
movz \Wn, (\imm >> 16) & 0xFFFF, lsl 16
movk \Wn, \imm & 0xFFFF
Expand Down Expand Up @@ -369,4 +389,4 @@ GLOBAL_FUNCTION(breakpoint):
brk 0
ret

END_SECTION
END_SECTION

0 comments on commit 7c5a3eb

Please sign in to comment.