diff options
author | Joe Zhao <ztuowen@gmail.com> | 2014-05-16 17:12:37 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2014-05-16 17:12:37 +0800 |
commit | 80469b4bfaf49a407d8d6b5bf3c2eb0d1c9870e6 (patch) | |
tree | 12c312dc2c7a32a5e987d4603b6179b5fab6d391 /rs422lib/sysctl.h | |
parent | b038c3b87564e9f4acac0019b18fd6d20692ac38 (diff) | |
download | rsbus-80469b4bfaf49a407d8d6b5bf3c2eb0d1c9870e6.tar.gz rsbus-80469b4bfaf49a407d8d6b5bf3c2eb0d1c9870e6.tar.bz2 rsbus-80469b4bfaf49a407d8d6b5bf3c2eb0d1c9870e6.zip |
Comments update
Diffstat (limited to 'rs422lib/sysctl.h')
-rw-r--r-- | rs422lib/sysctl.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/rs422lib/sysctl.h b/rs422lib/sysctl.h index 11b65ed..b8301fa 100644 --- a/rs422lib/sysctl.h +++ b/rs422lib/sysctl.h @@ -12,6 +12,8 @@ #ifndef SYSCTL_H_
#define SYSCTL_H_
+// Sysctl priority bit
+// Lowest first
#define SYS_BIT7 (0x80)
#define SYS_BIT6 (0x40)
#define SYS_BIT5 (0x20)
@@ -20,17 +22,34 @@ #define SYS_BIT2 (0x04)
#define SYS_BIT1 (0x02)
#define SYS_BIT0 (0x01)
+
+// SYSCALL invocation routine
+// Used this in IRQ, also wakes up the cpu
#define SYSCALL_IRQ(X) (syscall|=X,_BIC_SR_IRQ(CPUOFF))
+// Use this in anywhere other than IRQ
+// Continuous invocation ?
#define SYSCALL(X) (syscall|=X)
+// Call handler type
+// Does't have any input
+// Preserve the state in other global variables
+// Usage example -> rsbus_syscall()
typedef void (*syshdlr)();
-void sysctl_reghdlr(unsigned int bit,syshdlr rot);// Always replace
+// Register call handler
+// Always replace old value
+void sysctl_reghdlr(unsigned int bit,syshdlr rot);
-void sysctl_rmhdlr(unsigned int bit);// Replace with something useless
+// Remove old call handler
+// Replace with something useless
+void sysctl_rmhdlr(unsigned int bit);
+// Insert it into mainloop
+// enabling automatic procedure invocation
void sysroutine();
+// Setting up the proc base
+// Call before usage
void sysctl_init();
extern volatile unsigned char syscall;
|