summaryrefslogtreecommitdiff
path: root/rs422lib/sysctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'rs422lib/sysctl.h')
-rw-r--r--rs422lib/sysctl.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/rs422lib/sysctl.h b/rs422lib/sysctl.h
new file mode 100644
index 0000000..11b65ed
--- /dev/null
+++ b/rs422lib/sysctl.h
@@ -0,0 +1,38 @@
+/*
+ * sysctl.h
+ *
+ * Created on: 2014-4-26
+ * Author: Tuowen
+ */
+
+// Support 8 different syscalls
+// Possible improvement
+// CPUOFF all the time, wakeup after syscall invoked.
+
+#ifndef SYSCTL_H_
+#define SYSCTL_H_
+
+#define SYS_BIT7 (0x80)
+#define SYS_BIT6 (0x40)
+#define SYS_BIT5 (0x20)
+#define SYS_BIT4 (0x10)
+#define SYS_BIT3 (0x08)
+#define SYS_BIT2 (0x04)
+#define SYS_BIT1 (0x02)
+#define SYS_BIT0 (0x01)
+#define SYSCALL_IRQ(X) (syscall|=X,_BIC_SR_IRQ(CPUOFF))
+#define SYSCALL(X) (syscall|=X)
+
+typedef void (*syshdlr)();
+
+void sysctl_reghdlr(unsigned int bit,syshdlr rot);// Always replace
+
+void sysctl_rmhdlr(unsigned int bit);// Replace with something useless
+
+void sysroutine();
+
+void sysctl_init();
+
+extern volatile unsigned char syscall;
+
+#endif /* SYSCTL_H_ */