Oops, forgot some files
authorJohn Hodge <[email protected]>
Mon, 24 Oct 2011 10:44:58 +0000 (18:44 +0800)
committerJohn Hodge <[email protected]>
Mon, 24 Oct 2011 10:44:58 +0000 (18:44 +0800)
Kernel/arch/helpers.h [new file with mode: 0644]
Kernel/include/drv_pci_int.h [new file with mode: 0644]

diff --git a/Kernel/arch/helpers.h b/Kernel/arch/helpers.h
new file mode 100644 (file)
index 0000000..4d85fcb
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Acess2 Kernel
+ * - By John Hodge (thePowersGang)
+ *
+ * arch/helpers.h
+ * - Misc helper functions for the arch code
+ */
+#ifndef _ARCH_HELPERS_H_
+#define _ARCH_HELPERS_H_
+
+// Divide
+// - Find what power of two times Den is > Num
+// - Iterate down in bit significance
+//  > If the `N` value is greater than `D`, we can set this bit
+#define DEF_DIVMOD(s) Uint##s __divmod##s(Uint##s N, Uint##s D, Uint##s*Rem){\
+       Uint##s ret=0,add=1;\
+       while(N>=D&&add) {D<<=1;add<<=1;}\
+       while(add>1){\
+               add>>=1;D>>=1;\
+               if(N>=D){ret+=add;N-=D;}\
+       }\
+       if(Rem)*Rem = N;\
+       return ret;\
+}
+
+#endif
+
diff --git a/Kernel/include/drv_pci_int.h b/Kernel/include/drv_pci_int.h
new file mode 100644 (file)
index 0000000..f168141
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Acess2 Kernel
+ * - By John Hodge (thePowersGang)
+ *
+ * drv_pci_int.h
+ * - PCI internal definitions
+ */
+#ifndef _DRV_PCI_INT_H
+#define _DRV_PCI_INT_H
+
+#include <acess.h>
+
+extern Uint32  PCI_CfgReadDWord(Uint32 Addr);
+extern void    PCI_CfgWriteDWord(Uint32 Addr, Uint32 data);
+
+#endif
+

UCC git Repository :: git.ucc.asn.au