1*cde8f271Sriastradh /* $NetBSD: cpu.h,v 1.21 2022/02/16 23:49:26 riastradh Exp $ */ 27880a893Sis 37880a893Sis /* 47880a893Sis * Copyright (C) 1995-1997 Wolfgang Solfrank. 57880a893Sis * Copyright (C) 1995-1997 TooLs GmbH. 67880a893Sis * All rights reserved. 77880a893Sis * 87880a893Sis * Redistribution and use in source and binary forms, with or without 97880a893Sis * modification, are permitted provided that the following conditions 107880a893Sis * are met: 117880a893Sis * 1. Redistributions of source code must retain the above copyright 127880a893Sis * notice, this list of conditions and the following disclaimer. 137880a893Sis * 2. Redistributions in binary form must reproduce the above copyright 147880a893Sis * notice, this list of conditions and the following disclaimer in the 157880a893Sis * documentation and/or other materials provided with the distribution. 167880a893Sis * 3. All advertising materials mentioning features or use of this software 177880a893Sis * must display the following acknowledgement: 187880a893Sis * This product includes software developed by TooLs GmbH. 197880a893Sis * 4. The name of TooLs GmbH may not be used to endorse or promote products 207880a893Sis * derived from this software without specific prior written permission. 217880a893Sis * 227880a893Sis * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 237880a893Sis * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 247880a893Sis * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 257880a893Sis * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 267880a893Sis * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 277880a893Sis * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 287880a893Sis * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 297880a893Sis * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 307880a893Sis * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 317880a893Sis * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 327880a893Sis */ 33d9c77208Smatt #ifndef _AMIGAPPC_CPU_H_ 34d9c77208Smatt #define _AMIGAPPC_CPU_H_ 35d9c77208Smatt #define _MACHINE_CPU_H_ /* for <m68k/cpu.h> */ 360ce3451dSis 37d9c77208Smatt #if defined(_KERNEL) && !defined(_MODULE) 385ffc3508Saymeric #define CPU_MAXNUM 1 393055d8c0Sphx /* 403055d8c0Sphx * Amiga models 413055d8c0Sphx */ 42b6cfe437Sphx #define A1200 1200 43b6cfe437Sphx #define A3000 3000 44b6cfe437Sphx #define A4000 4000 45b6cfe437Sphx extern int machineid; 460ce3451dSis 470ce3451dSis /* 480ce3451dSis * Prototypes from amiga_init.c 490ce3451dSis */ 5002cdf4d2Sdsl void *alloc_z2mem(long); 510ce3451dSis 520ce3451dSis /* 530ce3451dSis * Prototypes from autoconf.c 540ce3451dSis */ 55e3e33492Sphx #define is_a600() 0 5602cdf4d2Sdsl int is_a1200(void); 5702cdf4d2Sdsl int is_a3000(void); 5802cdf4d2Sdsl int is_a4000(void); 59b6cfe437Sphx 60b6cfe437Sphx /* 61b6cfe437Sphx * Prototypes from machdep.c 62b6cfe437Sphx */ 63b6cfe437Sphx int dma_cachectl(void *, int); 64e8c5c358Sphx 65e8c5c358Sphx /* 66e8c5c358Sphx * Prototypes from powerpc/powerpc/trap.c 67e8c5c358Sphx */ 68e8c5c358Sphx int badaddr_read(void *, size_t, int *); 693055d8c0Sphx 703055d8c0Sphx /* 713055d8c0Sphx * Reorder protection when accessing device registers. 723055d8c0Sphx */ 73*cde8f271Sriastradh #define amiga_membarrier() __asm volatile("eieio" ::: "memory") 743055d8c0Sphx 753055d8c0Sphx /* 763055d8c0Sphx * Finish all bus operations and flush pipelines. 773055d8c0Sphx */ 78*cde8f271Sriastradh #define amiga_cpu_sync() __asm volatile("sync; isync" ::: "memory") 790ce3451dSis 80d9c77208Smatt #endif /* _KERNEL && !_MODULE */ 81d9c77208Smatt 82b6cfe437Sphx #include <powerpc/cpu.h> 83b6cfe437Sphx 84d9c77208Smatt #endif /* _AMIGAPPC_CPU_H_ */ 85