Include file updates
authorH. Peter Anvin <hpa@zytor.com>
Mon, 28 Aug 2006 09:45:55 +0000 (02:45 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 28 Aug 2006 09:45:55 +0000 (02:45 -0700)
com32/include/com32.h
com32/include/math.h [new file with mode: 0644]
com32/include/sys/fpu.h [new file with mode: 0644]

index 5706683..16cd792 100644 (file)
@@ -122,4 +122,26 @@ static inline void *MK_PTR(uint16_t __seg, uint16_t __offs)
   return (void *)((__seg << 4) + __offs);
 }
 
+/* Some tools to handle 16:16 far pointers in memory */
+
+struct __far_ptr {
+  uint32_t __ptr;
+} __attribute__((packed));
+
+typedef struct __far_ptr far_ptr_t;
+
+
+static inline void *GET_PTR(far_ptr_t __fptr)
+{
+  return MK_PTR(__fptr.__ptr >> 16, __fptr.__ptr);
+}
+
+static inline far_ptr_t FAR_PTR(void *__ptr)
+{
+  far_ptr_t __fptr;
+
+  __fptr.__ptr = (SEG(__ptr) << 16) + OFFS(__ptr);
+  return __fptr;
+}
+
 #endif /* _COM32_H */
diff --git a/com32/include/math.h b/com32/include/math.h
new file mode 100644 (file)
index 0000000..5aaa9ad
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _MATH_H
+#define _MATH_H
+
+double pow(double, double);
+double fabs(double);
+double strtod(const char *, char **);
+
+#endif /* _MATH_H */
diff --git a/com32/include/sys/fpu.h b/com32/include/sys/fpu.h
new file mode 100644 (file)
index 0000000..134ae59
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _SYS_FPU_H
+#define _SYS_FPU_H
+
+extern int x86_init_fpu(void);
+
+#endif /* _SYS_FPU_H */