Home | History | Annotate | Line # | Download | only in include
cpu.h revision 1.6
      1  1.6       is /*      $NetBSD: cpu.h,v 1.6 2001/02/18 19:08:16 is Exp $ */
      2  1.6       is 
      3  1.6       is /*
      4  1.6       is  * Copyright (C) 1995-1997 Wolfgang Solfrank.
      5  1.6       is  * Copyright (C) 1995-1997 TooLs GmbH.
      6  1.6       is  * All rights reserved.
      7  1.6       is  *
      8  1.6       is  * Redistribution and use in source and binary forms, with or without
      9  1.6       is  * modification, are permitted provided that the following conditions
     10  1.6       is  * are met:
     11  1.6       is  * 1. Redistributions of source code must retain the above copyright
     12  1.6       is  *    notice, this list of conditions and the following disclaimer.
     13  1.6       is  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.6       is  *    notice, this list of conditions and the following disclaimer in the
     15  1.6       is  *    documentation and/or other materials provided with the distribution.
     16  1.6       is  * 3. All advertising materials mentioning features or use of this software
     17  1.6       is  *    must display the following acknowledgement:
     18  1.6       is  *      This product includes software developed by TooLs GmbH.
     19  1.6       is  * 4. The name of TooLs GmbH may not be used to endorse or promote products
     20  1.6       is  *    derived from this software without specific prior written permission.
     21  1.6       is  *
     22  1.6       is  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
     23  1.6       is  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  1.6       is  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  1.6       is  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  1.6       is  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     27  1.6       is  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     28  1.6       is  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     29  1.6       is  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     30  1.6       is  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     31  1.6       is  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  1.6       is  */
     33  1.1       is #ifndef _MACHINE_CPU_H_
     34  1.1       is #define _MACHINE_CPU_H_
     35  1.1       is 
     36  1.2  thorpej #if defined(_KERNEL) && !defined(_LKM)
     37  1.2  thorpej #include "opt_lockdebug.h"
     38  1.2  thorpej #endif
     39  1.2  thorpej 
     40  1.1       is #include <machine/frame.h>
     41  1.1       is #include <machine/psl.h>
     42  1.1       is #include <machine/intr.h>
     43  1.1       is 
     44  1.3       is #include <sys/sched.h>
     45  1.2  thorpej struct cpu_info {
     46  1.2  thorpej 	struct schedstate_percpu ci_schedstate; /* scheduler state */
     47  1.2  thorpej #if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
     48  1.2  thorpej 	u_long ci_spin_locks;		/* # of spin locks held */
     49  1.2  thorpej 	u_long ci_simple_locks;		/* # of simple locks held */
     50  1.2  thorpej #endif
     51  1.2  thorpej };
     52  1.2  thorpej 
     53  1.2  thorpej #ifdef _KERNEL
     54  1.2  thorpej extern struct cpu_info cpu_info_store;
     55  1.2  thorpej 
     56  1.2  thorpej #define	curcpu()			(&cpu_info_store)
     57  1.2  thorpej 
     58  1.1       is u_long	clkread	__P((void));
     59  1.1       is void	physaccess	__P((caddr_t, caddr_t, int, int));
     60  1.2  thorpej 
     61  1.2  thorpej #endif /* _KERNEL */
     62  1.1       is 
     63  1.1       is /* ADAM: taken from macppc/cpu.h */
     64  1.1       is #define CLKF_USERMODE(frame)    (((frame)->srr1 & PSL_PR) != 0)
     65  1.1       is #define CLKF_BASEPRI(frame)     ((frame)->pri == 0)
     66  1.1       is #define CLKF_PC(frame)          ((frame)->srr0)
     67  1.1       is #define CLKF_INTR(frame)        ((frame)->depth > 0)
     68  1.1       is 
     69  1.5  mycroft #define	PROC_PC(p)		(trapframe(p)->srr0)
     70  1.5  mycroft 
     71  1.1       is #define cpu_swapout(p)
     72  1.1       is #define cpu_wait(p)
     73  1.1       is #define cpu_number()            0
     74  1.1       is 
     75  1.1       is extern void delay __P((unsigned));
     76  1.1       is #define DELAY(n)                delay(n)
     77  1.1       is 
     78  1.1       is extern __volatile int want_resched;
     79  1.1       is extern __volatile int astpending;
     80  1.1       is 
     81  1.4  thorpej #define need_resched(ci)          (want_resched = 1, astpending = 1)
     82  1.1       is #define need_proftick(p)        ((p)->p_flag |= P_OWEUPC, astpending = 1)
     83  1.1       is #define signotify(p)            (astpending = 1)
     84  1.1       is 
     85  1.1       is extern char bootpath[];
     86  1.1       is 
     87  1.1       is #if defined(_KERNEL) || defined(_STANDALONE)
     88  1.1       is #define CACHELINESIZE   32
     89  1.1       is #endif
     90  1.1       is 
     91  1.1       is /* ADAM: commented out to avoid CTL_MACHDEP_NAMES redefiniton (see below) */
     92  1.1       is /*#include <powerpc/cpu.h>*/
     93  1.1       is 
     94  1.1       is /* end of ADAM */
     95  1.1       is 
     96  1.1       is 
     97  1.1       is /* ADAM: maybe we will need this??? */
     98  1.1       is /* values for machineid (happen to be AFF_* settings of AttnFlags) */
     99  1.1       is /*
    100  1.1       is #define AMIGA_68020	(1L<<1)
    101  1.1       is #define AMIGA_68030	(1L<<2)
    102  1.1       is #define AMIGA_68040	(1L<<3)
    103  1.1       is #define AMIGA_68881	(1L<<4)
    104  1.1       is #define AMIGA_68882	(1L<<5)
    105  1.1       is #define	AMIGA_FPU40	(1L<<6)
    106  1.1       is #define AMIGA_68060	(1L<<7)
    107  1.1       is */
    108  1.1       is 
    109  1.1       is #ifdef _KERNEL
    110  1.1       is int machineid;
    111  1.1       is #endif
    112  1.1       is 
    113  1.1       is /* ADAM: copied from powerpc/cpu.h */
    114  1.1       is #ifndef _POWERPC_CPU_H_
    115  1.1       is #define _POWERPC_CPU_H_
    116  1.1       is 
    117  1.1       is extern void __syncicache __P((void *, int));
    118  1.1       is 
    119  1.1       is /*
    120  1.1       is  * CTL_MACHDEP definitions.
    121  1.1       is  */
    122  1.1       is #define CPU_CACHELINE   1
    123  1.1       is #define CPU_MAXID       2
    124  1.1       is 
    125  1.1       is #endif  /* _POWERPC_CPU_H_ */
    126  1.1       is 
    127  1.1       is /* ADAM: copied from amiga/cpu.h */
    128  1.1       is #define CTL_MACHDEP_NAMES { \
    129  1.1       is 	{ 0, 0 }, \
    130  1.1       is 	{ "console_device", CTLTYPE_STRUCT }, \
    131  1.1       is }
    132  1.1       is 
    133  1.1       is #ifdef _KERNEL
    134  1.1       is /*
    135  1.1       is  * Prototypes from amiga_init.c
    136  1.1       is  */
    137  1.1       is void    *alloc_z2mem __P((long));
    138  1.1       is 
    139  1.1       is /*
    140  1.1       is  * Prototypes from autoconf.c
    141  1.1       is  */
    142  1.1       is int     is_a1200 __P((void));
    143  1.1       is int     is_a3000 __P((void));
    144  1.1       is int     is_a4000 __P((void));
    145  1.1       is #endif
    146  1.1       is 
    147  1.1       is #endif /* !_MACHINE_CPU_H_ */
    148