summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-11-25 23:32:11 -0600
committerrcombs <rcombs@rcombs.me>2021-11-26 00:11:05 -0600
commit1975b0be7036506f96358f39c5abf5e8fa656113 (patch)
treefd5a99da2e6a2b373a8afc0a7316b6ebc5d510d2
parent4559adb89496564312598ef0a3b4301a1c2ae1a1 (diff)
downloadlibass-1975b0be7036506f96358f39c5abf5e8fa656113.tar.bz2
libass-1975b0be7036506f96358f39c5abf5e8fa656113.tar.xz
aarch64: add initial utility macros file
-rw-r--r--libass/aarch64/asm.S50
1 files changed, 50 insertions, 0 deletions
diff --git a/libass/aarch64/asm.S b/libass/aarch64/asm.S
new file mode 100644
index 0000000..3bddae0
--- /dev/null
+++ b/libass/aarch64/asm.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2021 rcombs
+ *
+ * This file is part of libass.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "config.h"
+
+.macro function name, export=1
+ .macro endfunc
+ .purgem endfunc
+ .endm
+ .text
+ .if \export
+ .global EXTERN_PREFIX\()ass_\name
+ .endif
+ .align 2
+ EXTERN_PREFIX\()ass_\name:
+.endmacro
+
+.macro const name, align=4
+ .macro endconst
+ .endm
+ .data
+ .align \align
+ \name:
+.endmacro
+
+.macro loadaddr reg, name
+#if CONFIG_DARWIN
+ adrp \reg, \name\()@PAGE
+ add \reg, \reg, #\name\()@PAGEOFF
+#elif !defined(PIC)
+ ldr \reg, =\name
+#else
+#error No support for PIC on this platform yet!
+#endif
+.endmacro