diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-11 20:48:14 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-11 20:48:14 +0000 |
commit | 153845bbfe0156dbea8440a7bb2ce79968c0180a (patch) | |
tree | afd11a19e979bf7c6e87fd518c6b2638cce1193d /sys/arch/m68k/include | |
parent | 8afd1e0abdf70e1817d86d751f72f294f5ba1724 (diff) |
Move common prototypes to <m68k/{cpu,param}.h> instead of incomplete
declarations in <machine/{cpu,param}.h> and elsewhere.
Diffstat (limited to 'sys/arch/m68k/include')
-rw-r--r-- | sys/arch/m68k/include/cpu.h | 60 | ||||
-rw-r--r-- | sys/arch/m68k/include/param.h | 35 |
2 files changed, 72 insertions, 23 deletions
diff --git a/sys/arch/m68k/include/cpu.h b/sys/arch/m68k/include/cpu.h index 232dd54eb5b..08494397e2f 100644 --- a/sys/arch/m68k/include/cpu.h +++ b/sys/arch/m68k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.12 2005/08/01 11:54:23 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.13 2006/06/11 20:48:13 miod Exp $ */ /* $NetBSD: cpu.h,v 1.3 1997/02/02 06:56:57 thorpej Exp $ */ /* @@ -54,21 +54,16 @@ * Individual ports are expected to define the following CPP symbols * in <machine/cpu.h> to enable conditional code: * - * M68K_MMU_MOTOROLA Machine has a Motorola MMU (incl. + * M68K_MMU_MOTOROLA Machine may have a Motorola MMU (incl. * 68851, 68030, 68040, 68060) * - * M68K_MMU_HP Machine has an HP MMU. + * M68K_MMU_HP Machine may have an HP MMU. * * Note also that while m68k-generic code conditionalizes on the * M68K_MMU_HP CPP symbol, none of the HP MMU definitions are in this * file (since none are used in otherwise sharable code). */ -/* - * XXX Much more could be pulled out of port-specific header files - * XXX and placed here. - */ - #ifdef _KERNEL /* * All m68k ports must provide these globals. @@ -184,7 +179,24 @@ extern int mmutype; /* MMU on this host */ #define CACHE60_ON (CACHE40_ON|IC60_CABC|IC60_EBC|DC60_ESB) #define CACHE60_OFF (CACHE40_OFF|IC60_CABC) +/* bits in the 68060 Processor Control Register */ +#define PCR_IDSHIFT 16 +#define PCR_IDMASK 0xffff +#define PCR_68060 0x430 +#define PCR_68060LC 0x431 +#define PCR_REVSHIFT 8 +#define PCR_REVMASK 0xff +#define PCR_DEBUG 0x80 +#define PCR_FPUDIS 0x02 +#define PCR_SUPERSCALAR 0x01 + #ifdef _KERNEL +struct frame; +struct fpframe; +struct pcb; +struct proc; +struct trapframe; + void copypage(void *fromaddr, void *toaddr); void zeropage(void *addr); #ifdef MAPPEDCOPY @@ -194,16 +206,38 @@ extern u_int mappedcopysize; #endif /* MAPPEDCOPY */ /* locore.s */ -u_long getdfc(void); -u_long getsfc(void); +void TBIS(vaddr_t); +void TBIAS(void); +void TBIAU(void); +void ICIA(void); +void DCIA(void); +void DCIS(void); +void DCIU(void); +#if defined(M68040) || defined(M68060) +void ICPA(void); +void DCFA(void); +void ICPL(paddr_t); +void ICPP(paddr_t); +void DCPL(paddr_t); +void DCPP(paddr_t); +void DCFL(paddr_t); +void DCFP(paddr_t); +#endif + +u_long getdfc(void); +u_long getsfc(void); +void loadustp(int); +void m68881_restore(struct fpframe *); +void m68881_save(struct fpframe *); +void proc_trampoline(void); +void savectx(struct pcb *); +int suline(caddr_t, caddr_t); +void switch_exit(struct proc *); /* m68k_machdep.c */ -struct proc; -struct frame; void userret(struct proc *, struct frame *, u_quad_t, u_int, int); /* regdump.c */ -struct trapframe; void regdump(struct trapframe *, int); /* sys_machdep.c */ diff --git a/sys/arch/m68k/include/param.h b/sys/arch/m68k/include/param.h index a6a53080625..31a9b77a19d 100644 --- a/sys/arch/m68k/include/param.h +++ b/sys/arch/m68k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.18 2006/03/19 01:47:24 martin Exp $ */ +/* $OpenBSD: param.h,v 1.19 2006/06/11 20:48:13 miod Exp $ */ /* $NetBSD: param.h,v 1.2 1997/06/10 18:21:23 veego Exp $ */ /* @@ -61,22 +61,35 @@ */ #define ALIGNBYTES (sizeof(int) - 1) #define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) -#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) +#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t) - 1)) == 0) +#define PAGE_SIZE (1 << PAGE_SHIFT) +#define PAGE_MASK (PAGE_SIZE - 1) + +#define PGSHIFT PAGE_SHIFT #define NBPG (1 << PGSHIFT) /* bytes/page */ #define PGOFSET (NBPG-1) /* byte offset into page */ -#define NPTEPG (NBPG/(sizeof (pt_entry_t))) + +#define NPTEPG (PAGE_SIZE / (sizeof(pt_entry_t))) + +#define BTOPKERNBASE ((u_long)KERNBASE >> PAGE_SHIFT) #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ #define DEV_BSIZE (1 << DEV_BSHIFT) #define BLKDEV_IOSIZE 2048 #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */ +#define SEGSHIFT020 (34 - PAGE_SHIFT) +#define SEGSHIFT040 (18) #ifndef SEGSHIFT #if defined(M68040) || defined(M68060) -#define SEGSHIFT ((mmutype <= MMU_68040) ? 18 : (34 - PGSHIFT)) +#if defined(M68020) || defined(M68030) +#define SEGSHIFT ((mmutype <= MMU_68040) ? SEGSHIFT040 : SEGSHIFT020) #else -#define SEGSHIFT (34 - PGSHIFT) +#define SEGSHIFT SEGSHIFT040 +#endif +#else +#define SEGSHIFT SEGSHOFT020 #endif #define NBSEG (1 << SEGSHIFT) #define SEGOFSET (NBSEG - 1) @@ -86,7 +99,7 @@ #ifndef UPAGES #define UPAGES 2 /* pages of u-area */ #endif -#define USPACE (UPAGES * NBPG) +#define USPACE (UPAGES * PAGE_SIZE) #define USPACE_ALIGN (0) /* u-area alignment 0-none */ /* @@ -114,12 +127,12 @@ #define NMBCLUSTERS 1024 /* map size, max cluster allocation */ /* pages ("clicks") to disk blocks */ -#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT)) -#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT)) +#define ctod(x) ((x) << (PAGE_SHIFT - DEV_BSHIFT)) +#define dtoc(x) ((x) >> (PAGE_SHIFT - DEV_BSHIFT)) /* pages to bytes */ -#define ctob(x) ((x) << PGSHIFT) -#define btoc(x) (((x) + PGOFSET) >> PGSHIFT) +#define ctob(x) ((x) << PAGE_SHIFT) +#define btoc(x) (((x) + PAGE_MASK) >> PAGE_SHIFT) /* bytes to disk blocks */ #define btodb(x) ((x) >> DEV_BSHIFT) @@ -146,4 +159,6 @@ ((unsigned)(v) & ~HPMMMASK) #endif /* COMPAT_HPUX */ +#include <machine/intr.h> /* splXXX() */ + #endif /* !_M68K_PARAM_H_ */ |