From a57a591f25d3a68094ebcfe7c9126eaf80ffb182 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Thu, 16 Aug 2012 17:07:24 +0200 Subject: [PATCH] Reorganize arch consts and types -DEFAULT_HZ const moved to archconst.h -cpu_info struct moved to archtypes.h --- include/arch/i386/include/Makefile | 2 +- include/arch/i386/include/archconst.h | 6 ++++++ include/arch/i386/include/archtypes.h | 9 +++++++++ include/minix/const.h | 6 +++--- include/minix/type.h | 9 --------- lib/libsys/tsc_util.c | 1 + 6 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 include/arch/i386/include/archconst.h diff --git a/include/arch/i386/include/Makefile b/include/arch/i386/include/Makefile index 8a1150c65..c8cbe69fd 100644 --- a/include/arch/i386/include/Makefile +++ b/include/arch/i386/include/Makefile @@ -10,7 +10,7 @@ INCS= ansi.h asm.h bswap.h byte_swap.h cdefs.h \ math.h mcontext.h npx.h param.h profile.h \ setjmp.h signal.h stdarg.h types.h \ vmparam.h wchar_limits.h \ - archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \ + archconst.h archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \ interrupt.h memory.h multiboot.h partition.h \ pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \ ports.h stackframe.h vm.h elf.h elf_machdep.h mutex.h \ diff --git a/include/arch/i386/include/archconst.h b/include/arch/i386/include/archconst.h new file mode 100644 index 000000000..027194c07 --- /dev/null +++ b/include/arch/i386/include/archconst.h @@ -0,0 +1,6 @@ +#ifndef _I386_CONST_H +#define _I386_CONST_H + +#define DEFAULT_HZ 60 /* clock freq (software settable on IBM-PC) */ + +#endif /* #ifndef _I386_CONST_H */ diff --git a/include/arch/i386/include/archtypes.h b/include/arch/i386/include/archtypes.h index 06263f6a5..cc3a6b478 100644 --- a/include/arch/i386/include/archtypes.h +++ b/include/arch/i386/include/archtypes.h @@ -35,6 +35,15 @@ typedef struct segframe { char *fpu_state; } segframe_t; +struct cpu_info { + u8_t vendor; + u8_t family; + u8_t model; + u8_t stepping; + u32_t freq; /* in MHz */ + u32_t flags[2]; +}; + typedef u32_t atomic_t; /* access to an aligned 32bit value is atomic on i386 */ #endif /* #ifndef _I386_TYPES_H */ diff --git a/include/minix/const.h b/include/minix/const.h index f1ed4bc7d..2a2d634dc 100644 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -1,6 +1,8 @@ #ifndef _MINIX_CONST_H #define _MINIX_CONST_H +#include + /* The UNUSED annotation tells the compiler or lint not to complain * about an unused variable or function parameter. * @@ -33,8 +35,6 @@ #define TRUE 1 /* used for turning integers into Booleans */ #define FALSE 0 /* used for turning integers into Booleans */ -#define DEFAULT_HZ 60 /* clock freq (software settable on IBM-PC) */ - #define SUPER_USER ((uid_t) 0) /* uid_t of superuser */ #include /* NULL Pointer */ @@ -75,7 +75,7 @@ #define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */ /* Memory is allocated in clicks. */ -#if defined(__i386__) +#if defined(__i386__) || defined(__arm__) #define CLICK_SIZE 4096 /* unit in which memory is allocated */ #define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */ #else diff --git a/include/minix/type.h b/include/minix/type.h index 6741b3091..dd1473209 100644 --- a/include/minix/type.h +++ b/include/minix/type.h @@ -90,15 +90,6 @@ struct loadinfo { clock_t last_clock; }; -struct cpu_info { - u8_t vendor; - u8_t family; - u8_t model; - u8_t stepping; - u32_t freq; /* in MHz */ - u32_t flags[2]; -}; - struct machine { unsigned processors_count; /* how many cpus are available */ unsigned bsp_id; /* id of the bootstrap cpu */ diff --git a/lib/libsys/tsc_util.c b/lib/libsys/tsc_util.c index 4c08e480a..d6dc1aff8 100644 --- a/lib/libsys/tsc_util.c +++ b/lib/libsys/tsc_util.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "sysutil.h"