summaryrefslogtreecommitdiffstats
path: root/pcm-assembler/pcm-assembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcm-assembler/pcm-assembler.h')
-rw-r--r--pcm-assembler/pcm-assembler.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/pcm-assembler/pcm-assembler.h b/pcm-assembler/pcm-assembler.h
new file mode 100644
index 0000000..ef7a655
--- /dev/null
+++ b/pcm-assembler/pcm-assembler.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2016-2017 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _PCM_ASSEMBLER_H_
+#define _PCM_ASSEMBLER_H_
+
+/*
+ * Values
+ */
+
+#define PCM_ASSEMBLER_ARGUMENTS_MAX 64
+
+/*
+ * Structures
+ */
+
+struct pcm_label_address {
+ char *label;
+ unsigned int address;
+};
+
+struct pcm_func_address {
+ char *func;
+ unsigned int address;
+
+ struct list_head *label_address;
+};
+
+struct pcm_ops_data {
+ struct list_head *func_address;
+ struct list_head *func_address_current;
+
+ int fd;
+};
+
+/*
+ * Functions
+ */
+
+int pcm_asm_write(void *data, unsigned int value, char *mnemonic);
+int pcm_asm_write_dummy(void *data, unsigned int value, char *mnemonic);
+int pcm_func_address(void *data, char *func);
+int pcm_label_address(void *data, char *func);
+int pcm_address_dummy(void *data, char *string);
+
+int pcm_func_address_register(char *func, unsigned int address);
+void pcm_func_address_flush(void);
+struct pcm_func_address *pcm_func_address_find(char *func);
+int pcm_func_address_current_set(char *func);
+int pcm_label_address_register(char *label, unsigned int address);
+void pcm_label_address_flush(void);
+struct pcm_label_address *pcm_label_address_find(char *label);
+
+#endif