summaryrefslogtreecommitdiffstats
path: root/libass/aarch64/asm.S
diff options
context:
space:
mode:
Diffstat (limited to 'libass/aarch64/asm.S')
-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