Reorganize arch consts and types

-DEFAULT_HZ const moved to archconst.h
-cpu_info struct moved to archtypes.h
This commit is contained in:
Arun Thomas 2012-08-16 17:07:24 +02:00
parent d69cc76e03
commit a57a591f25
6 changed files with 20 additions and 13 deletions

View file

@ -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 \

View file

@ -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 */

View file

@ -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 */

View file

@ -1,6 +1,8 @@
#ifndef _MINIX_CONST_H
#define _MINIX_CONST_H
#include <machine/archconst.h>
/* 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 <sys/null.h> /* 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

View file

@ -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 */

View file

@ -7,6 +7,7 @@
#include <minix/config.h>
#include <minix/const.h>
#include <minix/minlib.h>
#include <machine/archtypes.h>
#include "sysutil.h"