Initial AmigaPPC commit.
Lots of the work was done by Adam Ciarcinsky. Currently, this only supports CyberPPC boards by Phase 5. Blizzard PPC expected later. The kernel is useless but for demonstrating that it starts... especially interupts, and most of MMU support, is not in yet. Builtin console works, however, and you can look at the kernel startup messages.
This commit is contained in:
parent
d30834ad42
commit
0ce3451d1f
94
sys/arch/amigappc/amigappc/amiga_init.c
Normal file
94
sys/arch/amigappc/amigappc/amiga_init.c
Normal file
@ -0,0 +1,94 @@
|
||||
/* $NetBSD: amiga_init.c,v 1.1 2000/05/25 22:11:57 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Michael L. Hitch
|
||||
* Copyright (c) 1993 Markus Wild
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Markus Wild.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <vm/vm.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/msgbuf.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/domain.h>
|
||||
#include <sys/dkbad.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/exec.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <amiga/amiga/cc.h>
|
||||
|
||||
u_long boot_fphystart, boot_fphysize, cphysize;
|
||||
|
||||
vaddr_t z2mem_start; /* XXX */
|
||||
static vaddr_t z2mem_end; /* XXX */
|
||||
int use_z2_mem = 1; /* XXX */
|
||||
|
||||
void *
|
||||
chipmem_steal(amount)
|
||||
long amount;
|
||||
{
|
||||
/*
|
||||
* steal from top of chipmem, so we don't collide with
|
||||
* the kernel loaded into chipmem in the not-yet-mapped state.
|
||||
*/
|
||||
vaddr_t p = chipmem_end - amount;
|
||||
if (p & 1)
|
||||
p = p - 1;
|
||||
chipmem_end = p;
|
||||
if(chipmem_start > chipmem_end)
|
||||
panic("not enough chip memory");
|
||||
return((void *)p);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* used by certain drivers currently to allocate zorro II memory
|
||||
* for bounce buffers, if use_z2_mem is NULL, chipmem will be
|
||||
* returned instead.
|
||||
* XXX
|
||||
*/
|
||||
void *
|
||||
alloc_z2mem(amount)
|
||||
long amount;
|
||||
{
|
||||
if (use_z2_mem && z2mem_end && (z2mem_end - amount) >= z2mem_start) {
|
||||
z2mem_end -= amount;
|
||||
return ((void *)z2mem_end);
|
||||
}
|
||||
return (alloc_chipmem(amount));
|
||||
}
|
719
sys/arch/amigappc/amigappc/cc.c
Normal file
719
sys/arch/amigappc/amigappc/cc.c
Normal file
@ -0,0 +1,719 @@
|
||||
/* $NetBSD: cc.c,v 1.1 2000/05/25 22:11:57 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Christian E. Hopps.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <amiga/amiga/custom.h>
|
||||
#include <amiga/amiga/cc.h>
|
||||
#include "audio.h"
|
||||
|
||||
#if defined (__GNUC__)
|
||||
#define INLINE inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
|
||||
#ifdef __powerpc__
|
||||
#define PPC_CC_SYNC asm volatile ("eieio");
|
||||
#endif
|
||||
|
||||
/* init all the "custom chips" */
|
||||
void
|
||||
custom_chips_init()
|
||||
{
|
||||
cc_init_chipmem();
|
||||
cc_init_vbl();
|
||||
cc_init_audio();
|
||||
cc_init_blitter();
|
||||
cc_init_copper();
|
||||
}
|
||||
|
||||
/*
|
||||
* Vertical blank iterrupt sever chains.
|
||||
*/
|
||||
LIST_HEAD(vbllist, vbl_node) vbl_list;
|
||||
|
||||
void
|
||||
turn_vbl_function_off(n)
|
||||
struct vbl_node *n;
|
||||
{
|
||||
if (n->flags & VBLNF_OFF)
|
||||
return;
|
||||
|
||||
n->flags |= VBLNF_TURNOFF;
|
||||
while ((n->flags & VBLNF_OFF) == 0)
|
||||
;
|
||||
}
|
||||
|
||||
/* allow function to be called on next vbl interrupt. */
|
||||
void
|
||||
turn_vbl_function_on(n)
|
||||
struct vbl_node *n;
|
||||
{
|
||||
n->flags &= (short) ~(VBLNF_OFF);
|
||||
}
|
||||
|
||||
void
|
||||
add_vbl_function(add, priority, data)
|
||||
struct vbl_node *add;
|
||||
short priority;
|
||||
void *data;
|
||||
{
|
||||
int s;
|
||||
struct vbl_node *n, *prev;
|
||||
|
||||
s = spl3();
|
||||
prev = NULL;
|
||||
for (n = vbl_list.lh_first; n != NULL; n = n->link.le_next) {
|
||||
if (add->priority > n->priority) {
|
||||
/* insert add_node before. */
|
||||
if (prev == NULL) {
|
||||
LIST_INSERT_HEAD(&vbl_list, add, link);
|
||||
} else {
|
||||
LIST_INSERT_AFTER(prev, add, link);
|
||||
}
|
||||
add = NULL;
|
||||
break;
|
||||
}
|
||||
prev = n;
|
||||
}
|
||||
if (add) {
|
||||
if (prev == NULL) {
|
||||
LIST_INSERT_HEAD(&vbl_list, add, link);
|
||||
} else {
|
||||
LIST_INSERT_AFTER(prev, add, link);
|
||||
}
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
|
||||
void
|
||||
remove_vbl_function(n)
|
||||
struct vbl_node *n;
|
||||
{
|
||||
int s;
|
||||
|
||||
s = spl3();
|
||||
LIST_REMOVE(n, link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
/* Level 3 hardware interrupt */
|
||||
void
|
||||
vbl_handler()
|
||||
{
|
||||
struct vbl_node *n;
|
||||
|
||||
/* handle all vbl functions */
|
||||
for (n = vbl_list.lh_first; n != NULL; n = n->link.le_next) {
|
||||
if (n->flags & VBLNF_TURNOFF) {
|
||||
n->flags |= VBLNF_OFF;
|
||||
n->flags &= ~(VBLNF_TURNOFF);
|
||||
} else {
|
||||
if (n != NULL)
|
||||
n->function(n->data);
|
||||
}
|
||||
}
|
||||
custom.intreq = INTF_VERTB;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
cc_init_vbl()
|
||||
{
|
||||
LIST_INIT(&vbl_list);
|
||||
/*
|
||||
* enable vertical blank interrupts
|
||||
*/
|
||||
custom.intena = INTF_SETCLR | INTF_VERTB;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Blitter stuff.
|
||||
*/
|
||||
|
||||
void
|
||||
cc_init_blitter()
|
||||
{
|
||||
}
|
||||
|
||||
/* test twice to cover blitter bugs if BLTDONE (BUSY) is set it is not done. */
|
||||
int
|
||||
is_blitter_busy()
|
||||
{
|
||||
u_short bb;
|
||||
|
||||
bb = (custom.dmaconr & DMAF_BLTDONE);
|
||||
PPC_CC_SYNC
|
||||
if ((custom.dmaconr & DMAF_BLTDONE) || bb)
|
||||
{
|
||||
PPC_CC_SYNC
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
wait_blit()
|
||||
{
|
||||
/*
|
||||
* V40 state this covers all blitter bugs.
|
||||
*/
|
||||
while (is_blitter_busy())
|
||||
;
|
||||
}
|
||||
|
||||
void
|
||||
blitter_handler()
|
||||
{
|
||||
custom.intreq = INTF_BLIT;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
do_blit(size)
|
||||
u_short size;
|
||||
{
|
||||
custom.bltsize = size;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
set_blitter_control(con0, con1)
|
||||
u_short con0, con1;
|
||||
{
|
||||
custom.bltcon0 = con0;
|
||||
PPC_CC_SYNC
|
||||
custom.bltcon1 = con1;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
set_blitter_mods(a, b, c, d)
|
||||
u_short a, b, c, d;
|
||||
{
|
||||
custom.bltamod = a;
|
||||
PPC_CC_SYNC
|
||||
custom.bltbmod = b;
|
||||
PPC_CC_SYNC
|
||||
custom.bltcmod = c;
|
||||
PPC_CC_SYNC
|
||||
custom.bltdmod = d;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
set_blitter_masks(fm, lm)
|
||||
u_short fm, lm;
|
||||
{
|
||||
custom.bltafwm = fm;
|
||||
PPC_CC_SYNC
|
||||
custom.bltalwm = lm;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
set_blitter_data(da, db, dc)
|
||||
u_short da, db, dc;
|
||||
{
|
||||
custom.bltadat = da;
|
||||
PPC_CC_SYNC
|
||||
custom.bltbdat = db;
|
||||
PPC_CC_SYNC
|
||||
custom.bltcdat = dc;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
set_blitter_pointers(a, b, c, d)
|
||||
void *a, *b, *c, *d;
|
||||
{
|
||||
custom.bltapt = a;
|
||||
PPC_CC_SYNC
|
||||
custom.bltbpt = b;
|
||||
PPC_CC_SYNC
|
||||
custom.bltcpt = c;
|
||||
PPC_CC_SYNC
|
||||
custom.bltdpt = d;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
/*
|
||||
* Copper Stuff.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Wait till end of frame. We should probably better use the
|
||||
* sleep/wakeup system newly introduced in the vbl manager
|
||||
*/
|
||||
void
|
||||
wait_tof()
|
||||
{
|
||||
/*
|
||||
* wait until bottom of frame.
|
||||
*/
|
||||
while ((custom.vposr & 0x0007) == 0)
|
||||
PPC_CC_SYNC;
|
||||
|
||||
/*
|
||||
* wait until until top of frame.
|
||||
*/
|
||||
while (custom.vposr & 0x0007)
|
||||
PPC_CC_SYNC;
|
||||
|
||||
if (custom.vposr & 0x8000)
|
||||
{
|
||||
PPC_CC_SYNC
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* we are on short frame.
|
||||
* wait for long frame bit set
|
||||
*/
|
||||
while ((custom.vposr & 0x8000) == 0)
|
||||
PPC_CC_SYNC;
|
||||
}
|
||||
|
||||
cop_t *
|
||||
find_copper_inst(l, inst)
|
||||
cop_t *l;
|
||||
u_short inst;
|
||||
{
|
||||
cop_t *r = NULL;
|
||||
while ((l->cp.data & 0xff01ff01) != 0xff01ff00) {
|
||||
if (l->cp.inst.opcode == inst) {
|
||||
r = l;
|
||||
break;
|
||||
}
|
||||
l++;
|
||||
}
|
||||
return (r);
|
||||
}
|
||||
|
||||
void
|
||||
install_copper_list(l)
|
||||
cop_t *l;
|
||||
{
|
||||
wait_tof();
|
||||
wait_tof();
|
||||
custom.cop1lc = l;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cc_init_copper()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* level 3 interrupt
|
||||
*/
|
||||
void
|
||||
copper_handler()
|
||||
{
|
||||
custom.intreq = INTF_COPER;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
/*
|
||||
* Audio stuff.
|
||||
*/
|
||||
|
||||
|
||||
/* - channel[4] */
|
||||
/* the data for each audio channel and what to do with it. */
|
||||
struct audio_channel channel[4];
|
||||
|
||||
/* audio vbl node for vbl function */
|
||||
struct vbl_node audio_vbl_node;
|
||||
|
||||
void
|
||||
cc_init_audio()
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
* disable all audio interupts
|
||||
*/
|
||||
custom.intena = INTF_AUD0|INTF_AUD1|INTF_AUD2|INTF_AUD3;
|
||||
PPC_CC_SYNC
|
||||
|
||||
/*
|
||||
* initialize audio channels to off.
|
||||
*/
|
||||
for (i=0; i < 4; i++) {
|
||||
channel[i].play_count = 0;
|
||||
channel[i].isaudio=0;
|
||||
channel[i].handler=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Audio Interrupt Handler
|
||||
*/
|
||||
void
|
||||
audio_handler()
|
||||
{
|
||||
u_short audio_dma, disable_dma, flag, ir;
|
||||
int i;
|
||||
|
||||
audio_dma = custom.dmaconr;
|
||||
PPC_CC_SYNC
|
||||
disable_dma = 0;
|
||||
|
||||
/*
|
||||
* only check channels who have DMA enabled.
|
||||
*/
|
||||
audio_dma &= (DMAF_AUD0|DMAF_AUD1|DMAF_AUD2|DMAF_AUD3);
|
||||
|
||||
/*
|
||||
* disable all audio interupts with DMA set
|
||||
*/
|
||||
custom.intena = (audio_dma << INTB_AUD0) & AUCC_ALLINTF;
|
||||
PPC_CC_SYNC
|
||||
|
||||
/*
|
||||
* if no audio dma enabled then exit quick.
|
||||
*/
|
||||
if (!audio_dma) {
|
||||
/*
|
||||
* clear all interrupts.
|
||||
*/
|
||||
custom.intreq = AUCC_ALLINTF;
|
||||
PPC_CC_SYNC
|
||||
goto out;
|
||||
}
|
||||
for (i = 0; i < AUCC_MAXINT; i++) {
|
||||
flag = (1 << i);
|
||||
ir = custom.intreqr;
|
||||
PPC_CC_SYNC
|
||||
/*
|
||||
* is this channel's interrupt is set?
|
||||
*/
|
||||
if ((ir & (flag << INTB_AUD0)) == 0)
|
||||
continue;
|
||||
#if NAUDIO>0
|
||||
custom.intreq=(flag<<INTB_AUD0);
|
||||
PPC_CC_SYNC
|
||||
/* call audio handler with channel number */
|
||||
if (channel[i].isaudio==1)
|
||||
if (channel[i].handler)
|
||||
(*channel[i].handler)(i);
|
||||
#endif
|
||||
|
||||
if (channel[i].play_count)
|
||||
channel[i].play_count--;
|
||||
else {
|
||||
/*
|
||||
* disable DMA to this channel and
|
||||
* disable interrupts to this channel
|
||||
*/
|
||||
custom.dmacon = flag;
|
||||
PPC_CC_SYNC
|
||||
custom.intena = (flag << INTB_AUD0);
|
||||
PPC_CC_SYNC
|
||||
if (channel[i].isaudio==-1)
|
||||
channel[i].isaudio=0;
|
||||
}
|
||||
/*
|
||||
* clear this channels interrupt.
|
||||
*/
|
||||
custom.intreq = (flag << INTB_AUD0);
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
out:
|
||||
/*
|
||||
* enable audio interupts with dma still set.
|
||||
*/
|
||||
audio_dma = custom.dmaconr;
|
||||
PPC_CC_SYNC
|
||||
audio_dma &= (DMAF_AUD0|DMAF_AUD1|DMAF_AUD2|DMAF_AUD3);
|
||||
custom.intena = INTF_SETCLR | (audio_dma << INTB_AUD0);
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
void
|
||||
play_sample(len, data, period, volume, channels, count)
|
||||
u_short len, *data, period, volume, channels;
|
||||
u_long count;
|
||||
{
|
||||
u_short dmabits, ch;
|
||||
register int i;
|
||||
|
||||
dmabits = channels & 0xf;
|
||||
|
||||
/* check to see, whether all channels are free */
|
||||
for (i=0;i<4;i++) {
|
||||
if ((1<<i) & dmabits) {
|
||||
if (channel[i].isaudio)
|
||||
return; /* allocated */
|
||||
else
|
||||
channel[i].isaudio=-1; /* allocate */
|
||||
}
|
||||
}
|
||||
|
||||
custom.dmacon = dmabits; /* turn off the correct channels */
|
||||
PPC_CC_SYNC
|
||||
|
||||
/* load the channels */
|
||||
for (ch = 0; ch < 4; ch++) {
|
||||
if ((dmabits & (ch << ch)) == 0)
|
||||
continue;
|
||||
custom.aud[ch].len = len;
|
||||
PPC_CC_SYNC
|
||||
custom.aud[ch].lc = data;
|
||||
PPC_CC_SYNC
|
||||
custom.aud[ch].per = period;
|
||||
PPC_CC_SYNC
|
||||
custom.aud[ch].vol = volume;
|
||||
PPC_CC_SYNC
|
||||
channel[ch].play_count = count;
|
||||
}
|
||||
/*
|
||||
* turn on interrupts and enable dma for channels and
|
||||
*/
|
||||
custom.intena = INTF_SETCLR | (dmabits << INTB_AUD0);
|
||||
PPC_CC_SYNC
|
||||
custom.dmacon = DMAF_SETCLR | DMAF_MASTER |dmabits;
|
||||
PPC_CC_SYNC
|
||||
}
|
||||
|
||||
/*
|
||||
* Chipmem allocator.
|
||||
*/
|
||||
|
||||
static CIRCLEQ_HEAD(chiplist, mem_node) chip_list;
|
||||
static CIRCLEQ_HEAD(freelist, mem_node) free_list;
|
||||
static u_long chip_total; /* total free. */
|
||||
static u_long chip_size; /* size of it all. */
|
||||
|
||||
void
|
||||
cc_init_chipmem()
|
||||
{
|
||||
int s = splhigh ();
|
||||
struct mem_node *mem;
|
||||
|
||||
chip_size = chipmem_end - (chipmem_start + NBPG);
|
||||
chip_total = chip_size - sizeof(*mem);
|
||||
|
||||
mem = (struct mem_node *)chipmem_steal(chip_size);
|
||||
mem->size = chip_total;
|
||||
|
||||
CIRCLEQ_INIT(&chip_list);
|
||||
CIRCLEQ_INIT(&free_list);
|
||||
|
||||
CIRCLEQ_INSERT_HEAD(&chip_list, mem, link);
|
||||
CIRCLEQ_INSERT_HEAD(&free_list, mem, free_link);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
void *
|
||||
alloc_chipmem(size)
|
||||
u_long size;
|
||||
{
|
||||
int s;
|
||||
struct mem_node *mn, *new;
|
||||
|
||||
if (size == 0)
|
||||
return NULL;
|
||||
|
||||
s = splhigh();
|
||||
|
||||
if (size & ~(CM_BLOCKMASK))
|
||||
size = (size & CM_BLOCKMASK) + CM_BLOCKSIZE;
|
||||
|
||||
/*
|
||||
* walk list of available nodes.
|
||||
*/
|
||||
mn = free_list.cqh_first;
|
||||
while (size > mn->size && mn != (void *)&free_list)
|
||||
mn = mn->free_link.cqe_next;
|
||||
|
||||
if (mn == (void *)&free_list)
|
||||
return(NULL);
|
||||
|
||||
if ((mn->size - size) <= sizeof (*mn)) {
|
||||
/*
|
||||
* our allocation would not leave room
|
||||
* for a new node in between.
|
||||
*/
|
||||
CIRCLEQ_REMOVE(&free_list, mn, free_link);
|
||||
mn->free_link.cqe_next = NULL;
|
||||
size = mn->size; /* increase size. (or same) */
|
||||
chip_total -= mn->size;
|
||||
splx(s);
|
||||
return ((void *)&mn[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
* split the node's memory.
|
||||
*/
|
||||
new = mn;
|
||||
new->size -= size + sizeof(struct mem_node);
|
||||
mn = (struct mem_node *)(MNODES_MEM(new) + new->size);
|
||||
mn->size = size;
|
||||
|
||||
/*
|
||||
* add split node to node list
|
||||
* and mark as not on free list
|
||||
*/
|
||||
CIRCLEQ_INSERT_AFTER(&chip_list, new, mn, link);
|
||||
mn->free_link.cqe_next = NULL;
|
||||
|
||||
chip_total -= size + sizeof(struct mem_node);
|
||||
splx(s);
|
||||
return ((void *)&mn[1]);
|
||||
}
|
||||
|
||||
void
|
||||
free_chipmem(mem)
|
||||
void *mem;
|
||||
{
|
||||
struct mem_node *mn, *next, *prev;
|
||||
int s;
|
||||
|
||||
if (mem == NULL)
|
||||
return;
|
||||
|
||||
s = splhigh();
|
||||
mn = (struct mem_node *)mem - 1;
|
||||
next = mn->link.cqe_next;
|
||||
prev = mn->link.cqe_prev;
|
||||
|
||||
/*
|
||||
* check ahead of us.
|
||||
*/
|
||||
if (next->link.cqe_next != (void *)&chip_list &&
|
||||
next->free_link.cqe_next) {
|
||||
/*
|
||||
* if next is: a valid node and a free node. ==> merge
|
||||
*/
|
||||
CIRCLEQ_INSERT_BEFORE(&free_list, next, mn, free_link);
|
||||
CIRCLEQ_REMOVE(&chip_list, next, link);
|
||||
CIRCLEQ_REMOVE(&chip_list, next, free_link);
|
||||
chip_total += mn->size + sizeof(struct mem_node);
|
||||
mn->size += next->size + sizeof(struct mem_node);
|
||||
}
|
||||
if (prev->link.cqe_prev != (void *)&chip_list &&
|
||||
prev->free_link.cqe_prev) {
|
||||
/*
|
||||
* if prev is: a valid node and a free node. ==> merge
|
||||
*/
|
||||
if (mn->free_link.cqe_next == NULL)
|
||||
chip_total += mn->size + sizeof(struct mem_node);
|
||||
else {
|
||||
/* already on free list */
|
||||
CIRCLEQ_REMOVE(&free_list, mn, free_link);
|
||||
chip_total += sizeof(struct mem_node);
|
||||
}
|
||||
CIRCLEQ_REMOVE(&chip_list, mn, link);
|
||||
prev->size += mn->size + sizeof(struct mem_node);
|
||||
} else if (mn->free_link.cqe_next == NULL) {
|
||||
/*
|
||||
* we still are not on free list and we need to be.
|
||||
* <-- | -->
|
||||
*/
|
||||
while (next->link.cqe_next != (void *)&chip_list &&
|
||||
prev->link.cqe_prev != (void *)&chip_list) {
|
||||
if (next->free_link.cqe_next) {
|
||||
CIRCLEQ_INSERT_BEFORE(&free_list, next, mn,
|
||||
free_link);
|
||||
break;
|
||||
}
|
||||
if (prev->free_link.cqe_next) {
|
||||
CIRCLEQ_INSERT_AFTER(&free_list, prev, mn,
|
||||
free_link);
|
||||
break;
|
||||
}
|
||||
prev = prev->link.cqe_prev;
|
||||
next = next->link.cqe_next;
|
||||
}
|
||||
if (mn->free_link.cqe_next == NULL) {
|
||||
if (next->link.cqe_next == (void *)&chip_list) {
|
||||
/*
|
||||
* we are not on list so we can add
|
||||
* ourselves to the tail. (we walked to it.)
|
||||
*/
|
||||
CIRCLEQ_INSERT_TAIL(&free_list,mn,free_link);
|
||||
} else {
|
||||
CIRCLEQ_INSERT_HEAD(&free_list,mn,free_link);
|
||||
}
|
||||
}
|
||||
chip_total += mn->size; /* add our helpings to the pool. */
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
|
||||
u_long
|
||||
sizeof_chipmem(mem)
|
||||
void *mem;
|
||||
{
|
||||
struct mem_node *mn;
|
||||
|
||||
if (mem == NULL)
|
||||
return (0);
|
||||
mn = mem;
|
||||
mn--;
|
||||
return (mn->size);
|
||||
}
|
||||
|
||||
u_long
|
||||
avail_chipmem(largest)
|
||||
int largest;
|
||||
{
|
||||
struct mem_node *mn;
|
||||
u_long val;
|
||||
int s;
|
||||
|
||||
val = 0;
|
||||
if (largest == 0)
|
||||
val = chip_total;
|
||||
else {
|
||||
s = splhigh();
|
||||
for (mn = free_list.cqh_first; mn != (void *)&free_list;
|
||||
mn = mn->free_link.cqe_next) {
|
||||
if (mn->size > val)
|
||||
val = mn->size;
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
return (val);
|
||||
}
|
70
sys/arch/amigappc/amigappc/genassym.cf
Normal file
70
sys/arch/amigappc/amigappc/genassym.cf
Normal file
@ -0,0 +1,70 @@
|
||||
# $NetBSD: genassym.cf,v 1.1 2000/05/25 22:11:57 is Exp $
|
||||
|
||||
#
|
||||
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
# Copyright (C) 1995, 1996 TooLs GmbH.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by TooLs GmbH.
|
||||
# 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include <sys/param.h>
|
||||
include <sys/time.h>
|
||||
include <sys/proc.h>
|
||||
|
||||
include <vm/vm.h>
|
||||
|
||||
include <machine/pcb.h>
|
||||
include <machine/pmap.h>
|
||||
|
||||
define FRAMELEN FRAMELEN
|
||||
define FRAME_0 offsetof(struct trapframe, fixreg[0])
|
||||
define FRAME_1 offsetof(struct trapframe, fixreg[1])
|
||||
define FRAME_2 offsetof(struct trapframe, fixreg[2])
|
||||
define FRAME_3 offsetof(struct trapframe, fixreg[3])
|
||||
define FRAME_LR offsetof(struct trapframe, lr)
|
||||
define FRAME_CR offsetof(struct trapframe, cr)
|
||||
define FRAME_CTR offsetof(struct trapframe, ctr)
|
||||
define FRAME_XER offsetof(struct trapframe, xer)
|
||||
define FRAME_SRR0 offsetof(struct trapframe, srr0)
|
||||
define FRAME_SRR1 offsetof(struct trapframe, srr1)
|
||||
define FRAME_DAR offsetof(struct trapframe, dar)
|
||||
define FRAME_DSISR offsetof(struct trapframe, dsisr)
|
||||
define FRAME_EXC offsetof(struct trapframe, exc)
|
||||
|
||||
define SFRAMELEN roundup(sizeof(struct switchframe), 16)
|
||||
|
||||
define PCB_PMR offsetof(struct pcb, pcb_pmreal)
|
||||
define PCB_SP offsetof(struct pcb, pcb_sp)
|
||||
define PCB_SPL offsetof(struct pcb, pcb_spl)
|
||||
define PCB_FAULT offsetof(struct pcb, pcb_onfault)
|
||||
|
||||
define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR])
|
||||
define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR])
|
||||
|
||||
define P_FORW offsetof(struct proc, p_forw)
|
||||
define P_BACK offsetof(struct proc, p_back)
|
||||
define P_ADDR offsetof(struct proc, p_addr)
|
1437
sys/arch/amigappc/amigappc/locore.S
Normal file
1437
sys/arch/amigappc/amigappc/locore.S
Normal file
File diff suppressed because it is too large
Load Diff
891
sys/arch/amigappc/amigappc/machdep.c
Normal file
891
sys/arch/amigappc/amigappc/machdep.c
Normal file
@ -0,0 +1,891 @@
|
||||
/* $NetBSD: machdep.c,v 1.1 2000/05/25 22:11:57 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
* Copyright (C) 1995, 1996 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by TooLs GmbH.
|
||||
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_ipkdb.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/msgbuf.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_kern.h>
|
||||
|
||||
#include <machine/powerpc.h>
|
||||
#include <machine/bat.h>
|
||||
#include <machine/trap.h>
|
||||
#include <machine/hid.h>
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include <amiga/amiga/cc.h>
|
||||
#include <amiga/amiga/cia.h>
|
||||
|
||||
/*
|
||||
* Global variables used here and there
|
||||
* from macppc/machdep.c
|
||||
*/
|
||||
struct pcb *curpcb;
|
||||
struct pmap *curpm;
|
||||
struct proc *fpuproc;
|
||||
|
||||
extern struct user *proc0paddr;
|
||||
|
||||
/* from amiga/machdep.c */
|
||||
char cpu_model[80];
|
||||
char machine[] = MACHINE;
|
||||
char machine_arch[] = MACHINE_ARCH;
|
||||
|
||||
vm_map_t exec_map = NULL;
|
||||
vm_map_t mb_map = NULL;
|
||||
vm_map_t phys_map = NULL;
|
||||
|
||||
struct bat battable[16];
|
||||
extern int aga_enable, eclockfreq;
|
||||
|
||||
#define PPCMEMREGIONS 32
|
||||
static struct mem_region PPCmem[PPCMEMREGIONS + 1], PPCavail[PPCMEMREGIONS + 3];
|
||||
|
||||
void show_me_regs(void);
|
||||
|
||||
void
|
||||
initppc(startkernel, endkernel)
|
||||
u_int startkernel, endkernel;
|
||||
{
|
||||
extern void cpu_fail(void);
|
||||
extern adamint, adamintsize;
|
||||
extern extint, extsize;
|
||||
extern trapcode, trapsize;
|
||||
extern alitrap, alisize;
|
||||
extern dsitrap, dsisize;
|
||||
extern isitrap, isisize;
|
||||
extern decrint, decrsize;
|
||||
extern tlbimiss, tlbimsize;
|
||||
extern tlbdlmiss, tlbdlmsize;
|
||||
extern tlbdsmiss, tlbdsmsize;
|
||||
#ifdef DDB
|
||||
extern ddblow, ddbsize;
|
||||
#endif
|
||||
#ifdef IPKDB
|
||||
extern ipkdblow, ipkdbsize;
|
||||
#endif
|
||||
int exc, scratch;
|
||||
|
||||
/* force memory mapping */
|
||||
PPCmem[0].start = 0x8000000;
|
||||
PPCmem[0].size = 0x5f80000;
|
||||
PPCmem[1].start = 0x7c00000;
|
||||
PPCmem[1].size = 0x0400000;
|
||||
PPCmem[2].start = 0x0;
|
||||
PPCmem[2].size = 0x0;
|
||||
|
||||
PPCavail[0].start = 0x8000000;
|
||||
PPCavail[0].size = 0x5f80000;
|
||||
/*
|
||||
PPCavail[1].start = (0x7c00000 + endkernel + PGOFSET) & ~PGOFSET;
|
||||
PPCavail[1].size = 0x8000000 - PPCavail[1].start;
|
||||
*/
|
||||
PPCavail[1].start = 0x7c00000;
|
||||
PPCavail[1].size = 0x0400000;
|
||||
PPCavail[2].start = 0x0;
|
||||
PPCavail[2].size = 0x0;
|
||||
|
||||
CHIPMEMADDR = 0x0;
|
||||
chipmem_start = 0x0;
|
||||
chipmem_end = 0x200000;
|
||||
|
||||
CIAADDR = 0xbfd000;
|
||||
CIAAbase = CIAADDR + 0x1001;
|
||||
CIABbase = CIAADDR;
|
||||
|
||||
CUSTOMADDR = 0xdff000;
|
||||
CUSTOMbase = CUSTOMADDR;
|
||||
|
||||
eclockfreq = 709379;
|
||||
|
||||
aga_enable = 1;
|
||||
machineid = 4000 << 16;
|
||||
|
||||
/* Initialize BAT tables */
|
||||
battable[0].batl = BATL(0x00000000, BAT_I|BAT_G, BAT_PP_RW);
|
||||
battable[0].batu = BATU(0x00000000, BAT_BL_16M, BAT_Vs);
|
||||
battable[1].batl = BATL(0x08000000, 0, BAT_PP_RW);
|
||||
battable[1].batu = BATU(0x08000000, BAT_BL_128M, BAT_Vs);
|
||||
battable[2].batl = BATL(0x07000000, 0, BAT_PP_RW);
|
||||
battable[2].batu = BATU(0x07000000, BAT_BL_16M, BAT_Vs);
|
||||
battable[3].batl = BATL(0xfff00000, 0, BAT_PP_RW);
|
||||
battable[3].batu = BATU(0xfff00000, BAT_BL_512K, BAT_Vs);
|
||||
|
||||
/* Load BAT registers */
|
||||
asm volatile ("mtibatl 0,%0; mtibatu 0,%1;"
|
||||
"mtdbatl 0,%0; mtdbatu 0,%1" ::
|
||||
"r"(battable[0].batl), "r"(battable[0].batu));
|
||||
asm volatile ("mtibatl 1,%0; mtibatu 1,%1;"
|
||||
"mtdbatl 1,%0; mtdbatu 1,%1" ::
|
||||
"r"(battable[1].batl), "r"(battable[1].batu));
|
||||
asm volatile ("mtibatl 2,%0; mtibatu 2,%1;"
|
||||
"mtdbatl 2,%0; mtdbatu 2,%1" ::
|
||||
"r"(battable[2].batl), "r"(battable[2].batu));
|
||||
asm volatile ("mtibatl 3,%0; mtibatu 3,%1;"
|
||||
"mtdbatl 3,%0; mtdbatu 3,%1" ::
|
||||
"r"(battable[3].batl), "r"(battable[3].batu));
|
||||
|
||||
proc0.p_addr = proc0paddr;
|
||||
bzero(proc0.p_addr, sizeof *proc0.p_addr);
|
||||
curpcb = &proc0paddr->u_pcb;
|
||||
curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();
|
||||
|
||||
/*
|
||||
* Set up trap vectors
|
||||
*/
|
||||
for (exc = EXC_RSVD + EXC_UPPER; exc <= EXC_LAST + EXC_UPPER; exc += 0x100) {
|
||||
switch (exc - EXC_UPPER) {
|
||||
default:
|
||||
bcopy(&trapcode, (void *)exc, (size_t)&trapsize);
|
||||
break;
|
||||
case EXC_MCHK:
|
||||
bcopy(&adamint, (void *)exc, (size_t)&adamintsize);
|
||||
break;
|
||||
case EXC_EXI:
|
||||
bcopy(&extint, (void *)exc, (size_t)&extsize);
|
||||
/*
|
||||
* This one is (potentially) installed during autoconf
|
||||
*/
|
||||
break;
|
||||
case EXC_ALI:
|
||||
bcopy(&alitrap, (void *)exc, (size_t)&alisize);
|
||||
break;
|
||||
case EXC_DSI:
|
||||
bcopy(&dsitrap, (void *)exc, (size_t)&dsisize);
|
||||
break;
|
||||
case EXC_ISI:
|
||||
bcopy(&isitrap, (void *)exc, (size_t)&isisize);
|
||||
break;
|
||||
case EXC_DECR:
|
||||
bcopy(&decrint, (void *)exc, (size_t)&decrsize);
|
||||
break;
|
||||
case EXC_IMISS:
|
||||
bcopy(&tlbimiss, (void *)exc, (size_t)&tlbimsize);
|
||||
break;
|
||||
case EXC_DLMISS:
|
||||
bcopy(&tlbdlmiss, (void *)exc, (size_t)&tlbdlmsize);
|
||||
break;
|
||||
case EXC_DSMISS:
|
||||
bcopy(&tlbdsmiss, (void *)exc, (size_t)&tlbdsmsize);
|
||||
break;
|
||||
|
||||
#if defined(DDB) || defined(IPKDB)
|
||||
case EXC_PGM:
|
||||
case EXC_TRC:
|
||||
case EXC_BPT:
|
||||
#if defined(DDB)
|
||||
bcopy(&ddblow, (void *)exc, (size_t)&ddbsize);
|
||||
#else
|
||||
bcopy(&ipkdblow, (void *)exc, (size_t)&ipkdbsize);
|
||||
#endif
|
||||
break;
|
||||
#endif /* DDB || IPKDB */
|
||||
}
|
||||
}
|
||||
|
||||
/* External interrupt handler install
|
||||
*/
|
||||
__syncicache((void *)(EXC_RST + EXC_UPPER), EXC_LAST - EXC_RST + 0x100);
|
||||
|
||||
/*
|
||||
* Enable translation and interrupts
|
||||
*/
|
||||
asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0; isync" :
|
||||
"=r"(scratch) : "K"(PSL_IR|PSL_DR|PSL_ME|PSL_RI|PSL_EE));
|
||||
custom.intreq = 0xc000;
|
||||
|
||||
/*
|
||||
* Set the page size
|
||||
*/
|
||||
uvm_setpagesize();
|
||||
|
||||
/*
|
||||
* Initialize pmap module
|
||||
*/
|
||||
pmap_bootstrap(startkernel, endkernel);
|
||||
}
|
||||
|
||||
|
||||
/* show PPC registers */
|
||||
void show_me_regs()
|
||||
{
|
||||
register u_long scr0, scr1, scr2, scr3;
|
||||
|
||||
asm volatile ("mfspr %0,1; mfspr %1,8; mfspr %2,9; mfspr %3,18"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("XER %08lx\tLR %08lx\tCTR %08lx\tDSISR %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,19; mfspr %1,22; mfspr %2,25; mfspr %3,26"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("DAR %08lx\tDEC %08lx\tSDR1 %08lx\tSRR0 %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,27; mfspr %1,268; mfspr %2,269; mfspr %3,272"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("SRR1 %08lx\tTBL %08lx\tTBU %08lx\tSPRG0 %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,273; mfspr %1,274; mfspr %2,275; mfspr %3,282"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("SPRG1 %08lx\tSPRG2 %08lx\tSPRG3 %08lx\tEAR %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,528; mfspr %1,529; mfspr %2,530; mfspr %3,531"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("IBAT0U%08lx\tIBAT0L%08lx\tIBAT1U%08lx\tIBAT1L%08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,532; mfspr %1,533; mfspr %2,534; mfspr %3,535"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("IBAT2U%08lx\tIBAT2L%08lx\tIBAT3U%08lx\tIBAT3L%08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,536; mfspr %1,537; mfspr %2,538; mfspr %3,539"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("DBAT0U%08lx\tDBAT0L%08lx\tDBAT1U%08lx\tDBAT1L%08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,540; mfspr %1,541; mfspr %2,542; mfspr %3,543"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("DBAT2U%08lx\tDBAT2L%08lx\tDBAT3U%08lx\tDBAT3L%08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,1008; mfspr %1,1009; mfspr %2,1010; mfspr %3,1013"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("HID0 %08lx\tHID1 %08lx\tIABR %08lx\tDABR %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,953; mfspr %1,954; mfspr %2,957; mfspr %3,958"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("PCM1 %08lx\tPCM2 %08lx\tPCM3 %08lx\tPCM4 %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
|
||||
asm volatile ("mfspr %0,952; mfspr %1,956; mfspr %2,959; mfspr %3,955"
|
||||
: "=r"(scr0),"=r"(scr1),"=r"(scr2),"=r"(scr3) :);
|
||||
printf("MMCR0 %08lx\tMMCR1 %08lx\tSDA %08lx\tSIA %08lx\n",
|
||||
scr0, scr1, scr2, scr3);
|
||||
}
|
||||
|
||||
|
||||
paddr_t msgbuf_paddr;
|
||||
|
||||
/*
|
||||
* This is called during initppc, before the system is really initialized.
|
||||
* It shall provide the total and the available regions of RAM.
|
||||
* Both lists must have a zero-size entry as terminator.
|
||||
* The available regions need not take the kernel into account, but needs
|
||||
* to provide space for two additional entry beyond the terminating one.
|
||||
*/
|
||||
void
|
||||
mem_regions(memp, availp)
|
||||
struct mem_region **memp, **availp;
|
||||
{
|
||||
*memp = PPCmem;
|
||||
*availp = PPCavail;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Interrupt handler
|
||||
*/
|
||||
void
|
||||
intrhand()
|
||||
{
|
||||
register unsigned short ireq;
|
||||
|
||||
ireq = custom.intreqr;
|
||||
|
||||
/* transmit buffer empty */
|
||||
if (ireq & INTF_TBE) {
|
||||
#if NSER > 0
|
||||
ser_outintr();
|
||||
#else
|
||||
custom.intreq = INTF_TBE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* disk block */
|
||||
if (ireq & INTF_DSKBLK) {
|
||||
#if NFD > 0
|
||||
fdintr(0);
|
||||
#endif
|
||||
custom.intreq = INTF_DSKBLK;
|
||||
}
|
||||
|
||||
/* software */
|
||||
if (ireq & INTF_SOFTINT) {
|
||||
custom.intreq = INTF_SOFTINT;
|
||||
}
|
||||
|
||||
/* ports */
|
||||
if (ireq & INTF_PORTS) {
|
||||
custom.intreq = INTF_PORTS;
|
||||
}
|
||||
|
||||
/* vertical blank */
|
||||
if (ireq & INTF_VERTB) {
|
||||
vbl_handler();
|
||||
}
|
||||
|
||||
/* blitter */
|
||||
if (ireq & INTF_BLIT) {
|
||||
blitter_handler();
|
||||
}
|
||||
|
||||
/* copper */
|
||||
if (ireq & INTF_COPER) {
|
||||
copper_handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct isr *isr_ports;
|
||||
struct isr *isr_exter;
|
||||
|
||||
void
|
||||
add_isr(isr)
|
||||
struct isr *isr;
|
||||
{
|
||||
struct isr **p, *q;
|
||||
|
||||
p = isr->isr_ipl == 2 ? &isr_ports : &isr_exter;
|
||||
|
||||
while ((q = *p) != NULL) {
|
||||
p = &q->isr_forw;
|
||||
}
|
||||
isr->isr_forw = NULL;
|
||||
*p = isr;
|
||||
/* enable interrupt */
|
||||
custom.intena = isr->isr_ipl == 2 ? INTF_SETCLR | INTF_PORTS :
|
||||
INTF_SETCLR | INTF_EXTER;
|
||||
}
|
||||
|
||||
void
|
||||
remove_isr(isr)
|
||||
struct isr *isr;
|
||||
{
|
||||
struct isr **p, *q;
|
||||
|
||||
p = isr->isr_ipl == 6 ? &isr_exter : &isr_ports;
|
||||
|
||||
while ((q = *p) != NULL && q != isr) {
|
||||
p = &q->isr_forw;
|
||||
}
|
||||
if (q) {
|
||||
*p = q->isr_forw;
|
||||
}
|
||||
else {
|
||||
panic("remove_isr: handler not registered");
|
||||
}
|
||||
|
||||
/* disable interrupt if no more handlers */
|
||||
p = isr->isr_ipl == 6 ? &isr_exter : &isr_ports;
|
||||
if (*p == NULL) {
|
||||
custom.intena = isr->isr_ipl == 6 ? INTF_EXTER : INTF_PORTS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this is a handy package to have asynchronously executed
|
||||
* function calls executed at very low interrupt priority.
|
||||
* Example for use is keyboard repeat, where the repeat
|
||||
* handler running at splclock() triggers such a (hardware
|
||||
* aided) software interrupt.
|
||||
* Note: the installed functions are currently called in a
|
||||
* LIFO fashion, might want to change this to FIFO
|
||||
* later.
|
||||
*/
|
||||
struct si_callback {
|
||||
struct si_callback *next;
|
||||
void (*function) __P((void *rock1, void *rock2));
|
||||
void *rock1, *rock2;
|
||||
};
|
||||
static struct si_callback *si_callbacks;
|
||||
static struct si_callback *si_free;
|
||||
#ifdef DIAGNOSTIC
|
||||
static int ncb; /* number of callback blocks allocated */
|
||||
static int ncbd; /* number of callback blocks dynamically allocated */
|
||||
#endif
|
||||
|
||||
void
|
||||
alloc_sicallback()
|
||||
{
|
||||
struct si_callback *si;
|
||||
int s;
|
||||
|
||||
si = (struct si_callback *)malloc(sizeof(*si), M_TEMP, M_NOWAIT);
|
||||
if (si == NULL) {
|
||||
return;
|
||||
}
|
||||
s = splhigh();
|
||||
si->next = si_free;
|
||||
si_free = si;
|
||||
splx(s);
|
||||
#ifdef DIAGNOSTIC
|
||||
++ncb;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* should be in clock.c */
|
||||
volatile int tickspending;
|
||||
|
||||
/*
|
||||
* Initially we assume a processor with a bus frequency of 12.5 MHz.
|
||||
*/
|
||||
static u_long ticks_per_sec = 12500000;
|
||||
static u_long ns_per_tick = 80;
|
||||
static long ticks_per_intr;
|
||||
static volatile u_long lasttb;
|
||||
|
||||
void
|
||||
decr_intr(frame)
|
||||
struct clockframe *frame;
|
||||
{
|
||||
u_long tb;
|
||||
long tick;
|
||||
int nticks;
|
||||
|
||||
/*
|
||||
* Check whether we are initialized
|
||||
*/
|
||||
if (!ticks_per_intr) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Based on the actual time delay since the last decrementer reload,
|
||||
* we arrange for earlier interrupt next time.
|
||||
*/
|
||||
asm ("mftb %0; mfdec %1" : "=r"(tb), "=r"(tick));
|
||||
for (nticks = 0; tick < 0; nticks++) {
|
||||
tick += ticks_per_intr;
|
||||
}
|
||||
asm volatile ("mtdec %0" :: "r"(tick));
|
||||
/*
|
||||
* lasttb is used during microtime. Set it to the virtual
|
||||
* start of this tick interval.
|
||||
*/
|
||||
lasttb = tb + tick - ticks_per_intr;
|
||||
|
||||
uvmexp.intrs++;
|
||||
intrcnt[CNT_CLOCK]++;
|
||||
{
|
||||
int pri, msr;
|
||||
|
||||
pri = splclock();
|
||||
if (pri & (1 << SPL_CLOCK)) {
|
||||
tickspending += nticks;
|
||||
}
|
||||
else {
|
||||
nticks += tickspending;
|
||||
tickspending = 0;
|
||||
|
||||
/*
|
||||
* Reenable interrupts
|
||||
*/
|
||||
asm volatile ("mfmsr %0; ori %0, %0, %1; mtmsr %0"
|
||||
: "=r"(msr) : "K"(PSL_EE));
|
||||
|
||||
/*
|
||||
* Do standard timer interrupt stuff.
|
||||
* Do softclock stuff only on the last iteration.
|
||||
*/
|
||||
frame->pri = pri | (1 << SIR_CLOCK);
|
||||
while (--nticks > 0) {
|
||||
hardclock(frame);
|
||||
}
|
||||
frame->pri = pri;
|
||||
hardclock(frame);
|
||||
}
|
||||
splx(pri);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline u_quad_t
|
||||
mftb()
|
||||
{
|
||||
u_long scratch;
|
||||
u_quad_t tb;
|
||||
|
||||
asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw 0,%0,%1; bne 1b"
|
||||
: "=r"(tb), "=r"(scratch));
|
||||
return tb;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill in *tvp with current time with microsecond resolution.
|
||||
*/
|
||||
void
|
||||
microtime(tvp)
|
||||
struct timeval *tvp;
|
||||
{
|
||||
u_long tb, ticks;
|
||||
int msr, scratch;
|
||||
|
||||
asm volatile ("mfmsr %0; andi. %1,%0,%2; mtmsr %1"
|
||||
: "=r"(msr), "=r"(scratch) : "K"((u_short)~PSL_EE));
|
||||
asm ("mftb %0" : "=r"(tb));
|
||||
ticks = (tb - lasttb) * ns_per_tick;
|
||||
*tvp = time;
|
||||
asm volatile ("mtmsr %0" :: "r"(msr));
|
||||
ticks /= 1000;
|
||||
tvp->tv_usec += ticks;
|
||||
while (tvp->tv_usec >= 1000000) {
|
||||
tvp->tv_usec -= 1000000;
|
||||
tvp->tv_sec++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
delay(n)
|
||||
unsigned n;
|
||||
{
|
||||
u_quad_t tb;
|
||||
u_long tbh, tbl, scratch;
|
||||
|
||||
tb = mftb();
|
||||
tb += (n * 1000 + ns_per_tick - 1) / ns_per_tick;
|
||||
tbh = tb >> 32;
|
||||
tbl = tb;
|
||||
asm ("1: mftbu %0; cmplw %0,%1; blt 1b; bgt 2f;"
|
||||
"mftb %0; cmplw %0,%2; blt 1b; 2:"
|
||||
:: "r"(scratch), "r"(tbh), "r"(tbl));
|
||||
}
|
||||
|
||||
/*
|
||||
int
|
||||
sys_sysarch()
|
||||
{
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
void
|
||||
identifycpu()
|
||||
{
|
||||
register int pvr, hid1;
|
||||
char *mach, *cpu;
|
||||
|
||||
/* Amiga type */
|
||||
if (is_a4000()) {
|
||||
mach = "Amiga 4000";
|
||||
}
|
||||
else {
|
||||
mach = "Amiga 1200";
|
||||
}
|
||||
|
||||
/* find CPU type */
|
||||
asm ("mfpvr %0" : "=r"(pvr));
|
||||
switch (pvr >> 16) {
|
||||
case 1:
|
||||
cpu = "601";
|
||||
break;
|
||||
case 3:
|
||||
cpu = "603";
|
||||
break;
|
||||
case 4:
|
||||
cpu = "604";
|
||||
break;
|
||||
case 5:
|
||||
cpu = "602";
|
||||
break;
|
||||
case 6:
|
||||
cpu = "603e";
|
||||
break;
|
||||
case 7:
|
||||
cpu = "603e+";
|
||||
break;
|
||||
case 8:
|
||||
cpu = "750";
|
||||
break;
|
||||
case 9:
|
||||
cpu = "604e";
|
||||
break;
|
||||
case 12:
|
||||
cpu = "7400";
|
||||
break;
|
||||
case 20:
|
||||
cpu = "620";
|
||||
break;
|
||||
default:
|
||||
cpu = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
sprintf(cpu_model, "%s (%s rev.%x)", mach, cpu, pvr & 0xffff);
|
||||
printf("%s\n", cpu_model);
|
||||
}
|
||||
|
||||
/*
|
||||
* Machine dependent startup code
|
||||
*/
|
||||
void
|
||||
cpu_startup()
|
||||
{
|
||||
int i, size, base, residual;
|
||||
caddr_t v;
|
||||
vaddr_t minaddr, maxaddr;
|
||||
char pbuf[9];
|
||||
|
||||
initmsgbuf((caddr_t)msgbuf_paddr, round_page(MSGBUFSIZE));
|
||||
|
||||
proc0.p_addr = proc0paddr;
|
||||
v = (caddr_t)proc0paddr + USPACE;
|
||||
|
||||
printf(version);
|
||||
identifycpu();
|
||||
|
||||
format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
|
||||
printf("total memory = %s\n", pbuf);
|
||||
|
||||
/*
|
||||
* Find out how much space we need, allocate it,
|
||||
* and then give everything true virtual addresses
|
||||
*/
|
||||
size = (int)allocsys(NULL, NULL);
|
||||
if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(size))) == 0) {
|
||||
panic("startup: no room for tables");
|
||||
}
|
||||
if (allocsys(v, NULL) - v != size) {
|
||||
panic("startup: table size inconsistency");
|
||||
}
|
||||
|
||||
/*
|
||||
* Now allocate buffers proper; they are different than the above
|
||||
* in that they usually occupy more virtual memory than physical
|
||||
*/
|
||||
size = MAXBSIZE * nbuf;
|
||||
minaddr = 0;
|
||||
if (uvm_map(kernel_map, (vaddr_t *)&minaddr, round_page(size), NULL,
|
||||
UVM_UNKNOWN_OFFSET, UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE,
|
||||
UVM_INH_NONE, UVM_ADV_NORMAL, 0)) != KERN_SUCCESS) {
|
||||
panic("startup: cannot allocate VM for buffers");
|
||||
}
|
||||
buffers = (char *)minaddr;
|
||||
base = bufpages / nbuf;
|
||||
residual = bufpages % nbuf;
|
||||
if (base >= MAXBSIZE) {
|
||||
/* Don't want to alloc more physical mem than ever needed */
|
||||
base = MAXBSIZE;
|
||||
residual = 0;
|
||||
}
|
||||
for (i = 0; i < nbuf; i++) {
|
||||
vsize_t curbufsize;
|
||||
vaddr_t curbuf;
|
||||
struct vm_page *pg;
|
||||
|
||||
/*
|
||||
* Each buffer has MAXBSIZE bytes of VM space allocated.
|
||||
* Of that MAXBSIZE space, we allocate and map (base+1) pages
|
||||
* for the first "residual" buffers, and then we allocate
|
||||
* "base" pages for the rest.
|
||||
*/
|
||||
curbuf = (vaddr_t)buffers + i * MAXBSIZE;
|
||||
curbufsize = NBPG * (i < residual ? base + 1 : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL) {
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
}
|
||||
pmap_enter(kernel_map->pmap, curbuf,
|
||||
VM_PAGE_TO_PHYS(pg), VM_PROT_READ|VM_PROT_WRITE,
|
||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
|
||||
curbuf += PAGE_SIZE;
|
||||
curbufsize -= PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a submap for exec arguments. This map effectively
|
||||
* limits the number of processes exec'ing at any time
|
||||
*/
|
||||
exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
|
||||
16*NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
|
||||
|
||||
/*
|
||||
* Allocate a submap for physio
|
||||
*/
|
||||
phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
|
||||
VM_PHYS_SIZE, 0, FALSE, NULL);
|
||||
|
||||
/*
|
||||
* No need to allocate an mbuf cluster submap. Mbuf clusters
|
||||
* are allocated via the pool allocator, and we use direct-mapped
|
||||
* pool pages
|
||||
*/
|
||||
|
||||
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
|
||||
printf("avail memory = %s\n", pbuf);
|
||||
format_bytes(pbuf, sizeof(pbuf), bufpages * NBPG);
|
||||
printf("using %d buffers containing %s of memory\n", nbuf, pbuf);
|
||||
|
||||
/*
|
||||
* Set up the buffers, so they can be used to read disk labels
|
||||
*/
|
||||
bufinit();
|
||||
}
|
||||
|
||||
void
|
||||
cpu_dumpconf()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* consinit
|
||||
* Initialize system console.
|
||||
*/
|
||||
void
|
||||
consinit()
|
||||
{
|
||||
custom_chips_init();
|
||||
/*
|
||||
** Initialize the console before we print anything out.
|
||||
*/
|
||||
cninit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Set set up registers on exec.
|
||||
*/
|
||||
void
|
||||
setregs(p, pack, stack)
|
||||
struct proc *p;
|
||||
struct exec_package *pack;
|
||||
u_long stack;
|
||||
{
|
||||
struct trapframe *tf = trapframe(p);
|
||||
struct ps_strings arginfo;
|
||||
paddr_t pa;
|
||||
|
||||
bzero(tf, sizeof *tf);
|
||||
tf->fixreg[1] = -roundup(-stack + 8, 16);
|
||||
|
||||
/*
|
||||
* XXX Machine-independent code has already copied arguments and
|
||||
* XXX environment to userland. Get them back here
|
||||
*/
|
||||
(void)copyin((char *)PS_STRINGS, &arginfo, sizeof(arginfo));
|
||||
|
||||
/*
|
||||
* Set up arguments for _start():
|
||||
* _start(argc, argv, envp, obj, cleanup, ps_strings);
|
||||
* Notes:
|
||||
* - obj and cleanup are the auxilliary and termination
|
||||
* vectors. They are fixed up by ld.elf_so.
|
||||
* - ps_strings is a NetBSD extention, and will be
|
||||
* ignored by executables which are strictly
|
||||
* compliant with the SVR4 ABI.
|
||||
*
|
||||
* XXX We have to set both regs and retval here due to different
|
||||
* XXX calling convention in trap.c and init_main.c.
|
||||
*/
|
||||
tf->fixreg[3] = arginfo.ps_nargvstr;
|
||||
tf->fixreg[4] = (register_t)arginfo.ps_argvstr;
|
||||
tf->fixreg[5] = (register_t)arginfo.ps_envstr;
|
||||
tf->fixreg[6] = 0; /* auxillary vector */
|
||||
tf->fixreg[7] = 0; /* termination vector */
|
||||
tf->fixreg[8] = (register_t)PS_STRINGS; /* NetBSD extension */
|
||||
|
||||
tf->srr0 = pack->ep_entry;
|
||||
tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
|
||||
p->p_addr->u_pcb.pcb_flags = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Machine dependent system variables
|
||||
*/
|
||||
int
|
||||
cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
/* all sysctl names at this level are terminal */
|
||||
if (namelen != 1) {
|
||||
return ENOTDIR;
|
||||
}
|
||||
|
||||
switch (name[0]) {
|
||||
case CPU_CACHELINE:
|
||||
return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Halt or reboot the machine after syncing/dumping according to howto
|
||||
*/
|
||||
void
|
||||
cpu_reboot(howto, what)
|
||||
int howto;
|
||||
char *what;
|
||||
{
|
||||
static int syncing;
|
||||
static char str[256];
|
||||
|
||||
howto = 0;
|
||||
}
|
||||
|
||||
int
|
||||
lcsplx(ipl)
|
||||
int ipl;
|
||||
{
|
||||
return spllower(ipl); /* XXX */
|
||||
}
|
210
sys/arch/amigappc/conf/Makefile.amigappc
Normal file
210
sys/arch/amigappc/conf/Makefile.amigappc
Normal file
@ -0,0 +1,210 @@
|
||||
MACHTYPE=powerpc
|
||||
MACHINE_ARCH=powerpc
|
||||
MACHINE=amigappc
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
# This makefile is constructed from a machine description:
|
||||
# config machineid
|
||||
# Most changes should be made in the machine description
|
||||
# /sys/arch/amiga/conf/``machineid''
|
||||
# after which you should do
|
||||
# config machineid
|
||||
# Machine generic makefile changes should be made in
|
||||
# /sys/arch/amiga/conf/Makefile.amiga
|
||||
# after which config should be rerun for all machines of that type.
|
||||
#
|
||||
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
|
||||
# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
|
||||
#
|
||||
# -DTRACE compile in kernel tracing hooks
|
||||
# -DQUOTA compile in file system quotas
|
||||
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
|
||||
AR= /usr/pkg/cross/powerpc-netbsd/bin/ar
|
||||
AS= /usr/pkg/cross/powerpc-netbsd/bin/as
|
||||
CC= /usr/pkg/cross/powerpc-netbsd/bin/cc
|
||||
CPP= /usr/pkg/cross/lib/gcc-lib/powerpc-netbsd/egcs-2.91.60/cpp
|
||||
LD= /usr/pkg/cross/powerpc-netbsd/bin/ld
|
||||
LORDER?=lorder
|
||||
MKDEP?= mkdep
|
||||
NM= /usr/pkg/cross/powerpc-netbsd/bin/nm
|
||||
RANLIB= /usr/pkg/cross/powerpc-netbsd/bin/ranlib
|
||||
SIZE= /usr/pkg/cross/powerpc-netbsd/bin/size
|
||||
STRIP= /usr/pkg/cross/powerpc-netbsd/bin/strip
|
||||
TSORT?= tsort -q
|
||||
|
||||
COPTS?= -O2
|
||||
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
AMIGA= $S/arch/amigappc
|
||||
|
||||
HAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Damiga -DFPCOPROC
|
||||
CWARNFLAGS?= -Werror -Wreturn-type -Wpointer-arith
|
||||
.if (${HAVE_GCC28} != "")
|
||||
CWARNFLAGS+= -Wno-main
|
||||
.endif
|
||||
.if empty(IDENT:M-DPPC604E)
|
||||
CMACHFLAGS= -mcpu=603e
|
||||
.else
|
||||
CMACHFLAGS= -mcpu=604e
|
||||
.endif
|
||||
CFLAGS= ${DEBUG} ${CWARNFLAGS} ${COPTS} ${CMACHFLAGS} -msoft-float
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 0x7c00000 -e __start
|
||||
STRIPFLAGS= --strip-debug
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN= ${KERNLIB}
|
||||
.else
|
||||
LIBKERN= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
|
||||
NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
|
||||
NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
.SUFFIXES: .o .g
|
||||
|
||||
.g.o: ; echo This is a dummy rule and should not be executed.
|
||||
|
||||
NORMAL_G= gspa < $< | gspahextoc > $*.c; ${CC} -c ${CFLAGS} ${PROF} $*.c
|
||||
|
||||
%OBJS
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ= locore.o \
|
||||
param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD= @rm -f $@
|
||||
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g"
|
||||
LINKFLAGS+= -X
|
||||
SYSTEM_LD_TAIL+=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
.else
|
||||
LINKFLAGS+= -x
|
||||
.endif
|
||||
|
||||
%LOAD
|
||||
|
||||
assym.h: ${AMIGA}/amigappc/genassym.cf $S/kern/genassym.sh
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${AMIGA}/amigappc/genassym.cf > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: param.c Makefile
|
||||
${NORMAL_C}
|
||||
|
||||
ioconf.o: ioconf.c
|
||||
${NORMAL_C}
|
||||
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h
|
||||
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
|
||||
clean: __CLEANKERNEL
|
||||
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
|
||||
lint:
|
||||
@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
|
||||
${CFILES} ioconf.c param.c | \
|
||||
grep -v 'static function .* unused'
|
||||
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
|
||||
links:
|
||||
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
|
||||
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
|
||||
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
|
||||
sort -u | comm -23 - dontlink | \
|
||||
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
|
||||
sh makelinks && rm -f dontlink
|
||||
|
||||
SRCS= ${AMIGA}/amigappc/locore.S \
|
||||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amigappc/locore.S
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
# ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${AMIGA}/amigappc/genassym.cf
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network configuration
|
||||
uipc_proto.o: Makefile
|
||||
|
||||
# depend on maxusers
|
||||
machdep.o: Makefile
|
||||
|
||||
# depend on CPU configuration
|
||||
amiga_init.o locore.o pmap.o sys_machdep.o: Makefile
|
||||
bzsc.o bztzsc.o cbiisc.o cbsc.o flsc.o sbic.o: Makefile
|
||||
|
||||
# depends on defined(DRACO)
|
||||
a2kbbc.o: Makefile
|
||||
|
||||
# LEV6_DEFER blocks usage of audio interupt 3:
|
||||
aucc.o cc.o: Makefile
|
||||
|
||||
locore.o: ${AMIGA}/amigappc/locore.S assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
%RULES
|
323
sys/arch/amigappc/conf/NULL
Normal file
323
sys/arch/amigappc/conf/NULL
Normal file
@ -0,0 +1,323 @@
|
||||
# $NetBSD: NULL,v 1.1 2000/05/25 22:11:58 is Exp $
|
||||
#
|
||||
# This file was automatically created. Changes will be
|
||||
# lost when running make in this directory.
|
||||
#
|
||||
# Created from:
|
||||
#$ NetBSD: GENERIC,v 1.129 1999/10/15 21:50:34 is Exp $
|
||||
|
||||
include "arch/amigappc/conf/std.amigappc"
|
||||
|
||||
maxusers 8
|
||||
options RTC_OFFSET=0
|
||||
|
||||
#mainboards to support (in addition to Amiga)
|
||||
|
||||
#options BB060STUPIDROM # You need this, if you have a non-DraCo
|
||||
# MC68060 with an OS ROM up to (at least)
|
||||
# V40 (OS3.1) and want to boot with the
|
||||
# bootblock.
|
||||
# You do not need this if you have a DraCo,
|
||||
# have no 68060 or NEVER use the bootblock
|
||||
#options P5PPC68KBOARD # Phase5 PPC/68K board support
|
||||
|
||||
#processors this kernel should support
|
||||
|
||||
options PPC604E
|
||||
options PPC603E
|
||||
|
||||
#options M68060 # support for 060
|
||||
#options M060SP # MC68060 software support (Required for 060)
|
||||
|
||||
#options M68040 # support for 040
|
||||
#options FPSP # MC68040 floating point support
|
||||
#options M68030 # support for 030
|
||||
#options M68020 # support for 020/851
|
||||
#options FPU_EMULATE # FPU emulation
|
||||
|
||||
#Networking options
|
||||
|
||||
#options INET # IP networking support (Required)
|
||||
#options GATEWAY # Packet forwarding
|
||||
#options DIRECTED_BROADCAST # Broadcast across subnets
|
||||
#options MROUTING # Multicast routing
|
||||
#options NS # XNS
|
||||
#options NSIP # XNS tunneling over IP
|
||||
#options ISO,TPIP # OSI
|
||||
#options EON # OSI tunneling over IP
|
||||
#options CCITT,LLC,HDLC # X.25
|
||||
#options NETATALK # AppleTalk networking protocols
|
||||
#options PPP_BSDCOMP # BSD-Compress compression support for PPP
|
||||
#options PPP_DEFLATE # Deflate compression support for PPP
|
||||
#options PPP_FILTER # Active filter support for PPP (requires bpf)
|
||||
#options PFIL_HOOKS # pfil(9) packet filter hooks
|
||||
#options IPFILTER_LOG # ipmon(8) log support
|
||||
|
||||
file-system FFS # Berkeley fast file system
|
||||
#file-system EXT2FS # second extended file system (linux)
|
||||
#file-system LFS # log-structured filesystem (experimental)
|
||||
#file-system MFS # Memory based filesystem
|
||||
#file-system NFS # Network File System client side code
|
||||
#file-system ADOSFS # AmigaDOS file system
|
||||
#file-system CD9660 # ISO 9660 + Rock Ridge filesystem
|
||||
#file-system MSDOSFS # MS-DOS filesystem
|
||||
#file-system FDESC # user file descriptor filesystem
|
||||
#file-system KERNFS # kernel data-structure filesystem
|
||||
#file-system NULLFS # loopback filesystem
|
||||
#file-system PORTAL # Portal filesystem
|
||||
#file-system PROCFS # /proc filesystem
|
||||
#file-system UMAPFS # NULLFS + uid and gid remapping
|
||||
#file-system UNION # union filesystem
|
||||
|
||||
#Filesystem options
|
||||
#options QUOTA # User and group quotas in FFS
|
||||
#options FFS_EI # FFS Endian Independant support
|
||||
#options NFSSERVER # Network File System server side code
|
||||
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
|
||||
# immutable) behave as system flags.
|
||||
|
||||
#Compatability options for various existing systems
|
||||
|
||||
#options TCP_COMPAT_42 # compatibility with 4.2BSD TCP/IP
|
||||
#options COMPAT_43 # compatibility with 4.3BSD interfaces
|
||||
#options COMPAT_09 # compatibility with NetBSD 0.9
|
||||
#options COMPAT_10 # compatibility with NetBSD 1.0
|
||||
#options COMPAT_12 # compatibility with NetBSD 1.2
|
||||
#options COMPAT_13 # compatibility with NetBSD 1.3
|
||||
#options COMPAT_14 # compatibility with NetBSD 1.4
|
||||
#options COMPAT_SUNOS # Support to run Sun (m68k) executables
|
||||
#options COMPAT_SVR4 # Support to run SVR4 (m68k) executables
|
||||
#options COMPAT_NOMID # allow nonvalid machine id executables
|
||||
#options COMPAT_LINUX # Support to run Linux/m68k executables
|
||||
options EXEC_ELF32 # 32-bit ELF executables (Linux, SVR4)
|
||||
|
||||
#Support for System V IPC facilities.
|
||||
|
||||
#options SYSVSHM # System V-like shared memory
|
||||
#options SYSVMSG # System V-like messages
|
||||
#options SYSVSEM # System V-like semaphores
|
||||
|
||||
#Support for various kernel options
|
||||
|
||||
#options KTRACE # system call tracing support
|
||||
#options LKM # Loadable kernel modules
|
||||
#options UCONSOLE # anyone can redirect a virtual console
|
||||
#options INSECURE # allow, among other insecure stuff, LKM
|
||||
# loading in multi-user mode.
|
||||
#options SCSIVERBOSE # Verbose SCSI errors
|
||||
|
||||
#options NTP # NTP phase/frequency locked loop
|
||||
|
||||
#Misc. debugging options
|
||||
|
||||
#options DDB # Kernel debugger
|
||||
#options DDB_HISTORY_SIZE=100 # Enable history editing in DDB
|
||||
#options DIAGNOSTIC # Extra kernel sanity checks
|
||||
#options DEBUG # Enable misc. kernel debugging code
|
||||
#options SYSCALL_DEBUG # debug all syscalls.
|
||||
#options SCSIDEBUG # Add SCSI debugging statements
|
||||
#options PANICBUTTON # Forced crash via keypress (???)
|
||||
|
||||
#Amiga specific options
|
||||
|
||||
#options LIMITMEM=24 # Do not use more than LIMITMEM MB of the
|
||||
# first bank of RAM. (default: unlimited)
|
||||
#options NKPTADD=4 # set this for 4 additional KPT pages
|
||||
#options NKPTADDSHIFT=24 # set this for 1 additional KPT page
|
||||
# per 16 MB (1<<24 bytes) of RAM
|
||||
# define and decrease this, or define and
|
||||
# increase NKPTADD if you get "out of PT pages"
|
||||
# panics.
|
||||
|
||||
#ATTENTION: There is NO WARRANTY AT ALL that the sync will be complete
|
||||
#before the 10 secondinterval ends, or that KBDRESET does work at all.
|
||||
#options KBDRESET # sync on Ctrl-Amiga-Amiga
|
||||
|
||||
#These options improve performance with the built-in serial port
|
||||
#on slower Amigas. Try the larger buffers first then lev6_defer.
|
||||
#options SERIBUF_SIZE=4096
|
||||
#options SEROBUF_SIZE=32
|
||||
#options LEV6_DEFER # defers l6 to l4 (below serial l5)
|
||||
|
||||
#options RETINACONSOLE # enable code to allow retina to be console
|
||||
|
||||
#options ULOWELLCONSOLE # enable code to allow a2410 to be console
|
||||
#options CL5426CONSOLE # Cirrus console
|
||||
#options CV64CONSOLE # CyberVision console
|
||||
#options TSENGCONSOLE # Tseng console
|
||||
#options CV3DCONSOLE # CyberVision 64/3D console
|
||||
|
||||
#options GRF_ECS # Enhanced Chip Set
|
||||
options GRF_NTSC # NTSC
|
||||
options GRF_PAL # PAL
|
||||
#options GRF_A2024 # Support for the A2024
|
||||
options GRF_AGA # AGA Chip Set
|
||||
options GRF_AGA_VGA # AGA VGAONLY timing
|
||||
#options GRF_SUPER72 # AGA Super-72
|
||||
|
||||
#options KFONT_8X11 # 8x11 font
|
||||
|
||||
#This is how you would tell the kernel the A2410 oscillator frequencies:
|
||||
#The used frequencies are the defaults, and do not need option setting
|
||||
#options ULOWELL_OSC1=36000000
|
||||
#options ULOWELL_OSC2=66667000
|
||||
|
||||
#This is how you specify the blitting speed, higher values may speed up blits
|
||||
#a littel bit. If you raise this value too much some trash may appear.
|
||||
#the commented version is the default.
|
||||
#options RH_MEMCLK=61000000
|
||||
#this option enables the 64 bit sprite which does not work
|
||||
#for quite a few people. E.g. The cursor sprite will turn to a block
|
||||
#when moved to the top of the screen in X.
|
||||
#options RH_64BIT_SPRITE
|
||||
#enables fast scroll code appears to now work on 040 systems.
|
||||
#options RETINA_SPEED_HACK
|
||||
#enables the Hardwarecursor which does not work on some systems.
|
||||
#options RH_HARDWARECURSOR
|
||||
|
||||
grfcc0 at mainbus0 # custom chips
|
||||
#grfrt0 at zbus0 # retina II
|
||||
#grfrh0 at zbus0 # retina III
|
||||
#grfcl* at zbus0 # Picasso II/Piccalo/Spectrum
|
||||
#grful0 at zbus0 # A2410
|
||||
#grfcv0 at zbus0 # CyberVision 64
|
||||
#grfet* at zbus0 # Tseng (oMniBus, Domino, Merlin)
|
||||
#grfcv3d0 at zbus0 # CyberVision 64/3D
|
||||
|
||||
grf0 at grfcc0
|
||||
#grf1 at grfrt0
|
||||
#grf2 at grfrh0
|
||||
#grf3 at grfcl?
|
||||
#grf4 at grful0
|
||||
#grf5 at grfcv0
|
||||
#grf6 at grfet?
|
||||
#grf7 at grfcv3d0
|
||||
|
||||
ite0 at grf0 # terminal emulators for grfs
|
||||
#ite1 at grf1 # terminal emulators for grfs
|
||||
#ite2 at grf2 # terminal emulators for grfs
|
||||
#ite3 at grf3 # terminal emulators for grfs
|
||||
#ite4 at grf4 # terminal emulators for grfs
|
||||
#ite5 at grf5 # terminal emulators for grfs
|
||||
#ite6 at grf6 # terminal emulators for grfs
|
||||
#ite7 at grf7 # terminal emulators for grfs
|
||||
|
||||
#msc0 at zbus0 # A2232 MSC multiport serial.
|
||||
#mfc0 at zbus0 # MultiFaceCard I/O board
|
||||
#mfcs0 at mfc0 unit 0 # MFC serial
|
||||
#mfcs1 at mfc0 unit 1 # MFC serial
|
||||
#mfcp0 at mfc0 unit 0 # MFC parallel [not available yet]
|
||||
#mfc1 at zbus0 # MultiFaceCard 2nd I/O board
|
||||
#mfcs2 at mfc1 unit 0
|
||||
#mfcs3 at mfc1 unit 1
|
||||
#mfcp1 at mfc1 unit 0
|
||||
|
||||
#hyper* at zbus? # zbus HyperCom3/3+/4/4+
|
||||
#hyper* at mainbus0 # not yet: HyperCom1 + HyperCom3
|
||||
#com* at hyper? port ? # Hypercom3/4 serial ports
|
||||
#lpt* at hyper? port ? # Hypercom3+/4+ parallel port
|
||||
|
||||
#Amiga Mainboard devices (sans graphics and keyboard)
|
||||
|
||||
#ser0 at mainbus0 # Amiga onboard serial
|
||||
#par0 at mainbus0 # Amiga onboard parallel
|
||||
ms* at mainbus0 # Amiga mice
|
||||
#fdc0 at mainbus0 # Amiga FDC
|
||||
#fd* at fdc0 unit ? # floppy disks on the later
|
||||
a34kbbc0 at mainbus0 # A3000/A4000 battery backed clock
|
||||
#a2kbbc0 at mainbus0 # A2000 battery backed clock
|
||||
#aucc* at mainbus0 # Amiga CC audio
|
||||
#audio* at aucc?
|
||||
|
||||
#Zorro-II, Zorro-III, DraCo Direct-Bus devices (sans graphics)
|
||||
|
||||
#Alas, Melody-Z2 dont configure in the DraCo bus.
|
||||
#melody* at zbus0 # Melody MPEG audio decoder
|
||||
#audio* at melody?
|
||||
|
||||
#Ethernet cards:
|
||||
#le* at zbus0 # A2065, Ameristar, Ariadne
|
||||
#ne* at zbus0 # AriadneII
|
||||
#ed* at zbus0 # Hydra, ASDG LanRover
|
||||
#es* at zbus0 # CEI A4066 EthernetPLUS
|
||||
#qn* at zbus0 # Quicknet
|
||||
|
||||
#bah* at zbus0 # C=/Ameristar A2060 / 560
|
||||
|
||||
#Greater Valley Product Bus
|
||||
#gvpbus* at zbus0
|
||||
|
||||
#scsi stuff, all possible
|
||||
#gtsc0 at gvpbus? # GVP series II scsi
|
||||
#scsibus* at gtsc0
|
||||
#ahsc0 at mainbus0 # A3000 scsi
|
||||
#scsibus* at ahsc0
|
||||
#atzsc0 at zbus0 # A2091 scsi
|
||||
#scsibus* at atzsc0
|
||||
#wstsc0 at zbus0 # Wordsync II scsi
|
||||
#scsibus* at wstsc0
|
||||
#ivsc0 at zbus0 # IVS scsi
|
||||
#scsibus* at ivsc0
|
||||
#mlhsc0 at zbus0 # Hacker scsi
|
||||
#scsibus* at mlhsc0
|
||||
#otgsc0 at zbus0 # 12 gauge scsi
|
||||
#scsibus* at otgsc0
|
||||
#zssc0 at zbus0 # Zeus scsi
|
||||
#scsibus* at zssc0
|
||||
#mgnsc0 at zbus0 # Magnum scsi
|
||||
#scsibus* at mgnsc0
|
||||
#wesc0 at zbus0 # Warp Engine scsi
|
||||
#scsibus* at wesc0
|
||||
#afsc0 at zbus0 # A4091 scsi
|
||||
#scsibus* at afsc0
|
||||
#aftsc0 at mainbus0 # A4000T scsi
|
||||
#scsibus* at aftsc0
|
||||
#flsc0 at zbus0 # FastlaneZ3 scsi
|
||||
#scsibus* at flsc0
|
||||
#bzsc0 at zbus0 # Blizzard 1230 I,II scsi
|
||||
#scsibus* at bzsc0
|
||||
#bzivsc0 at zbus0 # Blizzard 12x0 IV scsi
|
||||
#scsibus* at bzivsc0
|
||||
#bztzsc0 at zbus0 # Blizzard 2060 scsi
|
||||
#scsibus* at bztzsc0
|
||||
#cbsc0 at zbus0 # CyberSCSI I
|
||||
#scsibus* at cbsc0
|
||||
#cbiisc0 at zbus0 # CyberSCSI II
|
||||
#scsibus* at cbiisc0
|
||||
#cbiiisc0 at zbus0 # Cyberstorm mk.III/Cyberstorm PPC SCSI
|
||||
#scsibus* at cbiiisc0
|
||||
#empsc0 at zbus0 # Emplant scsi
|
||||
#scsibus* at empsc0
|
||||
#idesc0 at mainbus0 # A4000 & A1200 IDE
|
||||
#scsibus* at idesc0
|
||||
|
||||
#each hard drive from low target to high
|
||||
#will configure to the next available sd unit number
|
||||
#sd* at scsibus? target ? lun ? # scsi disks
|
||||
#st* at scsibus? target ? lun ? # scsi tapes
|
||||
#cd* at scsibus? target ? lun ? # scsi cds
|
||||
#ss* at scsibus? target ? lun ? # scsi scanner
|
||||
#ch* at scsibus? target ? lun ? # scsi autochangers
|
||||
#uk* at scsibus? target ? lun ? # scsi unknown
|
||||
|
||||
#pseudo-device loop # loopback network interface
|
||||
#pseudo-device sl 1 # SLIP network interfaces
|
||||
#pseudo-device ppp 1 # PPP network interfaces
|
||||
#pseudo-device tun 1 # network tunnel line discipline
|
||||
#pseudo-device gre 2 # generic L3 over IP tunnel
|
||||
#pseudo-device ipip 2 # IP Encapsulation within IP (RFC 2003)
|
||||
#pseudo-device bpfilter 16 # Berkeley packet filter
|
||||
#pseudo-device ipfilter # IP Filter package
|
||||
|
||||
pseudo-device view 4 # views (needed for grfcc)
|
||||
pseudo-device pty 16 # pseudo ptys
|
||||
|
||||
#pseudo-device vnd 4 # vnode pseudo-disks
|
||||
#pseudo-device ccd 4 # concatenated disk devices
|
||||
#pseudo-device raid 4 # RAIDframe disk driver
|
||||
|
||||
#rnd is EXPERIMENTAL at this point.
|
||||
#pseudo-device rnd # /dev/random and in-kernel generator
|
||||
#options RND_COM # use "com" randomness as well (BROKEN)
|
||||
|
||||
config netbsd root on ? type ?
|
416
sys/arch/amigappc/conf/files.amigappc
Normal file
416
sys/arch/amigappc/conf/files.amigappc
Normal file
@ -0,0 +1,416 @@
|
||||
# $NetBSD: files.amigappc,v 1.1 2000/05/25 22:11:58 is Exp $
|
||||
|
||||
# maxpartitions must be first item in files.${ARCH}.newconf
|
||||
maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL!
|
||||
|
||||
maxusers 2 8 64
|
||||
|
||||
defopt opt_amigaccgrf.h GRF_PAL:GRF_NTSC # temporary workaround
|
||||
defopt opt_amigaccgrf.h GRF_NTSC
|
||||
defopt opt_amigaccgrf.h GRF_ECS GRF_AGA
|
||||
defopt opt_amigaccgrf.h GRF_A2024:GRF_ECS
|
||||
defopt opt_amigaccgrf.h GRF_AGA_VGA:GRF_AGA
|
||||
defopt opt_amigaccgrf.h GRF_SUPER72:GRF_AGA
|
||||
defopt opt_amigaccgrf.h USE_C_BFOPS
|
||||
|
||||
defopt opt_amigacons.h RETINACONSOLE ULOWELLCONSOLE CL5426CONSOLE
|
||||
defopt opt_amigacons.h CV64CONSOLE CV3DCONSOLE TSENGCONSOLE
|
||||
defopt opt_amigacons.h CV3DONZORRO2
|
||||
|
||||
defopt opt_retina.h RH_MEMCLK RH_64BIT_SPRITE RH_HARDWARECURSOR
|
||||
defopt opt_retina.h RETINA_SPEED_HACK
|
||||
|
||||
defopt BB060STUPIDROM
|
||||
defopt P5PPC68KBOARD
|
||||
|
||||
device mainbus {}
|
||||
attach mainbus at root
|
||||
|
||||
device cpu
|
||||
attach cpu at mainbus
|
||||
|
||||
# zorro expansion bus.
|
||||
device zbus {}
|
||||
attach zbus at mainbus
|
||||
file arch/amiga/dev/zbus.c zbus
|
||||
|
||||
define event {}
|
||||
file arch/amiga/dev/event.c event
|
||||
|
||||
device clock
|
||||
attach clock at mainbus
|
||||
file arch/amiga/dev/clock.c
|
||||
file dev/clock_subr.c
|
||||
|
||||
# A2000 internal hwc
|
||||
device a2kbbc
|
||||
attach a2kbbc at mainbus
|
||||
file arch/amiga/dev/a2kbbc.c a2kbbc
|
||||
|
||||
# A3000/4000 internal hwc
|
||||
device a34kbbc
|
||||
attach a34kbbc at mainbus
|
||||
file arch/amiga/dev/a34kbbc.c a34kbbc
|
||||
|
||||
# keyboard
|
||||
device kbd: event
|
||||
attach kbd at mainbus
|
||||
file arch/amiga/dev/kbd.c kbd needs-flag
|
||||
|
||||
# serial port
|
||||
device ser: tty
|
||||
attach ser at mainbus
|
||||
file arch/amiga/dev/ser.c ser needs-count
|
||||
|
||||
# parallel port
|
||||
device par
|
||||
attach par at mainbus
|
||||
file arch/amiga/dev/par.c par needs-count
|
||||
|
||||
# audio
|
||||
device aucc: audio
|
||||
attach aucc at mainbus
|
||||
file arch/amiga/dev/aucc.c aucc needs-flag
|
||||
|
||||
device melody: audio, tms320av110
|
||||
attach melody at zbus
|
||||
file arch/amiga/dev/melody.c melody
|
||||
|
||||
# mouse
|
||||
device ms: event
|
||||
attach ms at mainbus
|
||||
file arch/amiga/dev/ms.c ms needs-flag
|
||||
|
||||
# floppy
|
||||
device fdc { unit = -1 }
|
||||
attach fdc at mainbus
|
||||
|
||||
device fd: disk
|
||||
attach fd at fdc
|
||||
file arch/amiga/dev/fd.c fd needs-flag
|
||||
major {fd = 2}
|
||||
|
||||
# graphic devices
|
||||
define grfbus {}
|
||||
|
||||
device grf {}
|
||||
attach grf at grfbus
|
||||
file arch/amiga/dev/grf.c grf needs-count
|
||||
|
||||
device ite: tty
|
||||
attach ite at grf
|
||||
file arch/amiga/dev/ite.c ite needs-flag
|
||||
file arch/amiga/dev/kbdmap.c ite
|
||||
file arch/amiga/dev/kf_8x8.c ite
|
||||
file arch/amiga/dev/kf_8x11.c kfont_8x11
|
||||
file arch/amiga/dev/kf_custom.c kfont_custom
|
||||
|
||||
# custom chips grf (ite0 grf0)
|
||||
device grfcc: grfbus
|
||||
attach grfcc at mainbus
|
||||
file arch/amiga/dev/grf_cc.c grfcc needs-flag
|
||||
file arch/amiga/dev/ite_cc.c grfcc & ite
|
||||
|
||||
defpseudo view
|
||||
file arch/amiga/dev/view.c view | grfcc needs-count
|
||||
file arch/amiga/dev/grfabs.c grfcc | view
|
||||
file arch/amiga/dev/grfabs_cc.c grfcc | view
|
||||
file arch/amiga/dev/grfabs_ccglb.c grfcc | view
|
||||
|
||||
# retina ZII grf (ite1 grf1)
|
||||
device grfrt: grfbus
|
||||
attach grfrt at zbus
|
||||
file arch/amiga/dev/grf_rt.c grfrt needs-flag
|
||||
file arch/amiga/dev/ite_rt.c grfrt & ite
|
||||
|
||||
# retina ZIII grf (ite2 grf2)
|
||||
device grfrh: grfbus
|
||||
attach grfrh at zbus
|
||||
file arch/amiga/dev/grf_rh.c grfrh needs-flag
|
||||
file arch/amiga/dev/ite_rh.c grfrh & ite
|
||||
|
||||
# cirrus grf (ite3 grf3)
|
||||
device grfcl: grfbus
|
||||
attach grfcl at zbus
|
||||
file arch/amiga/dev/grf_cl.c grfcl needs-flag
|
||||
file arch/amiga/dev/ite_cl.c grfcl & ite
|
||||
|
||||
# A2410 grf (ite4 grf4)
|
||||
device grful: grfbus
|
||||
attach grful at zbus
|
||||
file arch/amiga/dev/grf_ul.c grful needs-flag
|
||||
file arch/amiga/dev/ite_ul.c grful & ite
|
||||
file arch/amiga/dev/grf_ultms.g grful
|
||||
|
||||
# CyberVison 64 grf (ite5 grf5)
|
||||
device grfcv: grfbus
|
||||
attach grfcv at zbus
|
||||
file arch/amiga/dev/grf_cv.c grfcv needs-flag
|
||||
file arch/amiga/dev/ite_cv.c grfcv & ite
|
||||
|
||||
# Tseng grf (ite6 grf6)
|
||||
device grfet: grfbus
|
||||
attach grfet at zbus
|
||||
file arch/amiga/dev/grf_et.c grfet needs-flag
|
||||
file arch/amiga/dev/ite_et.c grfet & ite
|
||||
|
||||
# CyberVison 64/3D grf (ite7 grf7)
|
||||
device grfcv3d: grfbus
|
||||
attach grfcv3d at zbus
|
||||
file arch/amiga/dev/grf_cv3d.c grfcv3d needs-flag
|
||||
file arch/amiga/dev/ite_cv3d.c grfcv3d & ite
|
||||
|
||||
# device defined in sys/conf/files
|
||||
# A2065, Ameristar, Ariadne ethernet cards
|
||||
attach le at zbus with le_zbus: le24
|
||||
file arch/amiga/dev/if_le.c le_zbus needs-flag
|
||||
|
||||
# AriadneII ethernet card
|
||||
# device defined in sys/conf/files
|
||||
attach ne at zbus with ne_zbus: rtl80x9
|
||||
file arch/amiga/dev/if_ne_zbus.c ne_zbus needs-flag
|
||||
|
||||
# Hydra ethernet card
|
||||
device ed: ifnet, ether, arp
|
||||
attach ed at zbus with ed_zbus
|
||||
file arch/amiga/dev/if_ed.c ed_zbus needs-flag
|
||||
|
||||
# C=/Ameristar A2060 / 560
|
||||
attach bah at zbus with bah_zbus
|
||||
file arch/amiga/dev/if_bah_zbus.c bah_zbus
|
||||
|
||||
# CEI A4066 EthernetPLUS
|
||||
device es: ifnet, ether, arp
|
||||
attach es at zbus
|
||||
file arch/amiga/dev/if_es.c es needs-flag
|
||||
|
||||
# Quicknet ethernet card
|
||||
device qn: ifnet, ether, arp
|
||||
attach qn at zbus
|
||||
file arch/amiga/dev/if_qn.c qn needs-flag
|
||||
|
||||
# A2232 msc serial ports
|
||||
device msc: tty
|
||||
attach msc at zbus
|
||||
file arch/amiga/dev/msc.c msc needs-count
|
||||
|
||||
# bsc/Alf Data MultiFaceCard
|
||||
device mfc { unit = -1 }
|
||||
attach mfc at zbus
|
||||
|
||||
device mfcs: tty
|
||||
attach mfcs at mfc
|
||||
device mfcp
|
||||
attach mfcp at mfc
|
||||
file arch/amiga/dev/mfc.c mfcs | mfcp needs-count
|
||||
|
||||
# direct bus ISA-chip i/o
|
||||
define supio {port = -1}
|
||||
|
||||
# DraCo superio chip
|
||||
|
||||
device drsupio: supio
|
||||
attach drsupio at mainbus
|
||||
file arch/amiga/dev/drsupio.c drsupio
|
||||
|
||||
# ZBus HyperComs: HyperCom Z3, HyperCom 4
|
||||
device hyper: supio
|
||||
attach hyper at zbus
|
||||
file arch/amiga/dev/hyper.c hyper
|
||||
|
||||
attach com at supio with com_supio
|
||||
file arch/amiga/dev/com_supio.c com_supio
|
||||
|
||||
# ISDN Blaster, ISDN Master
|
||||
device aster: supio
|
||||
attach aster at zbus
|
||||
file arch/amiga/dev/aster.c aster
|
||||
|
||||
# handle gvp's odd autoconf info..
|
||||
device gvpbus {}
|
||||
attach gvpbus at zbus
|
||||
file arch/amiga/dev/gvpbus.c gvpbus
|
||||
|
||||
device lpt
|
||||
file dev/ic/lpt.c lpt needs-flag
|
||||
|
||||
attach lpt at supio with lpt_supio
|
||||
file arch/amiga/dev/lpt_supio.c lpt_supio
|
||||
|
||||
include "dev/scsipi/files.scsipi"
|
||||
major {sd = 4}
|
||||
major {cd = 7}
|
||||
|
||||
# wd 33c93 contrllers
|
||||
define sbic
|
||||
file arch/amiga/dev/sbic.c sbic
|
||||
|
||||
# GVP series II
|
||||
device gtsc: scsi, sbic
|
||||
attach gtsc at gvpbus
|
||||
file arch/amiga/dev/gtsc.c gtsc needs-flag
|
||||
|
||||
# Amiga 3000 internal
|
||||
device ahsc: scsi, sbic
|
||||
attach ahsc at mainbus
|
||||
file arch/amiga/dev/ahsc.c ahsc needs-flag
|
||||
|
||||
# C= A2091
|
||||
device atzsc: scsi, sbic
|
||||
attach atzsc at zbus
|
||||
file arch/amiga/dev/atzsc.c atzsc needs-flag
|
||||
|
||||
# ncr 5380 controllers
|
||||
define sci
|
||||
file arch/amiga/dev/sci.c sci
|
||||
|
||||
# Supra Wordsync II
|
||||
device wstsc: scsi, sci
|
||||
attach wstsc at zbus
|
||||
file arch/amiga/dev/wstsc.c wstsc needs-flag
|
||||
|
||||
# IVS
|
||||
device ivsc: scsi, sci
|
||||
attach ivsc at zbus
|
||||
file arch/amiga/dev/ivsc.c ivsc needs-flag
|
||||
|
||||
# MLH
|
||||
device mlhsc: scsi, sci
|
||||
attach mlhsc at zbus
|
||||
file arch/amiga/dev/mlhsc.c mlhsc needs-flag
|
||||
|
||||
# CSA twelve gauge.
|
||||
device otgsc: scsi, sci
|
||||
attach otgsc at zbus
|
||||
file arch/amiga/dev/otgsc.c otgsc needs-flag
|
||||
|
||||
# ncr 57c710 controllers
|
||||
define siop
|
||||
file arch/amiga/dev/siop.c siop
|
||||
|
||||
# PPI Zeus
|
||||
device zssc: scsi, siop
|
||||
attach zssc at zbus
|
||||
file arch/amiga/dev/zssc.c zssc needs-flag
|
||||
|
||||
# CSA Magnum
|
||||
device mgnsc: scsi, siop
|
||||
attach mgnsc at zbus
|
||||
file arch/amiga/dev/mgnsc.c mgnsc needs-flag
|
||||
|
||||
# MacroSystems USA Warp Engine
|
||||
device wesc: scsi, siop
|
||||
attach wesc at zbus
|
||||
file arch/amiga/dev/wesc.c wesc needs-flag
|
||||
|
||||
# C= A4091 & A4000T
|
||||
device afsc: scsi, siop
|
||||
attach afsc at zbus
|
||||
device aftsc: scsi, siop
|
||||
attach aftsc at mainbus
|
||||
file arch/amiga/dev/afsc.c afsc | aftsc needs-flag
|
||||
|
||||
# ncr 57c720/770 controllers
|
||||
define siopng
|
||||
file arch/amiga/dev/siop2.c siopng
|
||||
|
||||
# CyberStorm MKIII scsi
|
||||
device cbiiisc: scsi, siopng
|
||||
attach cbiiisc at zbus
|
||||
file arch/amiga/dev/cbiiisc.c cbiiisc needs-flag
|
||||
|
||||
# Emulex ESP216 & FAS216 controllers
|
||||
|
||||
# FastlaneZ3
|
||||
device flsc: scsi, ncr53c9x
|
||||
attach flsc at zbus
|
||||
file arch/amiga/dev/flsc.c flsc needs-flag
|
||||
|
||||
# Blizzard1230-I,II
|
||||
device bzsc: scsi, ncr53c9x
|
||||
attach bzsc at zbus
|
||||
file arch/amiga/dev/bzsc.c bzsc needs-flag
|
||||
|
||||
# Blizzard12x0-IV
|
||||
device bzivsc: scsi, ncr53c9x
|
||||
attach bzivsc at zbus
|
||||
file arch/amiga/dev/bzivsc.c bzivsc needs-flag
|
||||
|
||||
# Blizzard2060 scsi
|
||||
device bztzsc: scsi, ncr53c9x
|
||||
attach bztzsc at zbus
|
||||
file arch/amiga/dev/bztzsc.c bztzsc needs-flag
|
||||
|
||||
# CyberSCSI [I] scsi
|
||||
device cbsc: scsi, ncr53c9x
|
||||
attach cbsc at zbus
|
||||
file arch/amiga/dev/cbsc.c cbsc needs-flag
|
||||
|
||||
# CyberSCSI MKII scsi
|
||||
device cbiisc: scsi, ncr53c9x
|
||||
attach cbiisc at zbus
|
||||
file arch/amiga/dev/cbiisc.c cbiisc needs-flag
|
||||
|
||||
# EMPLANT
|
||||
device empsc: scsi, sci
|
||||
attach empsc at zbus
|
||||
file arch/amiga/dev/empsc.c empsc needs-flag
|
||||
|
||||
# Amiga 4000/1200 IDE masquerading as SCSI
|
||||
device idesc: scsi
|
||||
attach idesc at mainbus
|
||||
file arch/amiga/dev/idesc.c idesc needs-flag
|
||||
|
||||
# MacroSystem DraCo internal
|
||||
device drsc: scsi, siop
|
||||
attach drsc at mainbus
|
||||
file arch/amiga/dev/drsc.c drsc needs-flag
|
||||
|
||||
# MacroSystem DraCo internal DS2404 hwc
|
||||
device drbbc
|
||||
attach drbbc at mainbus
|
||||
file arch/amiga/dev/drbbc.c drbbc
|
||||
|
||||
# list of standard files...
|
||||
|
||||
file dev/cons.c ite | ser
|
||||
file dev/cninit.c ite | ser
|
||||
file arch/amigappc/amigappc/amiga_init.c
|
||||
file arch/amiga/amiga/autoconf.c
|
||||
file arch/amiga/amiga/busfuncs.c
|
||||
file arch/amiga/amiga/cia.c
|
||||
file arch/amiga/amiga/conf.c
|
||||
file arch/amiga/amiga/disksubr.c
|
||||
file arch/amiga/amiga/dkbad.c
|
||||
file arch/amigappc/amigappc/machdep.c
|
||||
file arch/amiga/amiga/cc.c
|
||||
file arch/amiga/dev/md_root.c memory_disk_hooks
|
||||
#file arch/m68k/m68k/cacheops.c
|
||||
|
||||
define gayle
|
||||
file arch/amiga/amiga/gayle.c gayle
|
||||
|
||||
include "dev/ata/files.ata"
|
||||
major {wd = 17}
|
||||
|
||||
# Amiga 4000/1200 IDE using MI wdc
|
||||
attach wdc at mainbus with wdc_amiga: gayle
|
||||
file arch/amiga/dev/wdc_amiga.c wdc_amiga
|
||||
|
||||
major {md = 15} # Memory disk (for mini-kernel)
|
||||
|
||||
# Compatibility modules
|
||||
|
||||
# SunOS Binary Compatibility (COMPAT_SUNOS)
|
||||
#include "compat/sunos/files.sunos"
|
||||
#file arch/m68k/m68k/sunos_machdep.c compat_sunos
|
||||
|
||||
# SVR4 Binary Compatibility (COMPAT_SVR4)
|
||||
#include "compat/svr4/files.svr4"
|
||||
|
||||
# Linux binary compatibility (COMPAT_LINUX)
|
||||
#include "compat/linux/files.linux"
|
||||
#include "compat/linux/arch/m68k/files.linux_m68k"
|
||||
|
||||
# OSS audio driver compatibility
|
||||
include "compat/ossaudio/files.ossaudio"
|
14
sys/arch/amigappc/conf/std.amigappc
Normal file
14
sys/arch/amigappc/conf/std.amigappc
Normal file
@ -0,0 +1,14 @@
|
||||
# $NetBSD: std.amigappc,v 1.1 2000/05/25 22:11:58 is Exp $
|
||||
|
||||
# standard amiga information
|
||||
|
||||
machine amigappc powerpc
|
||||
|
||||
mainbus0 at root
|
||||
|
||||
clock0 at mainbus0
|
||||
kbd0 at mainbus0
|
||||
zbus0 at mainbus0
|
||||
|
||||
options EXEC_ELF
|
||||
options EXEC_SCRIPT
|
13
sys/arch/amigappc/include/Makefile
Normal file
13
sys/arch/amigappc/include/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
# $NetBSD: Makefile,v 1.1 2000/05/25 22:11:58 is Exp $
|
||||
|
||||
KDIR= /sys/arch/amiga/include
|
||||
INCSDIR= /usr/include/amiga
|
||||
|
||||
INCS= ansi.h aout_machdep.h asm.h bswap.h bus.h cdefs.h conf.h cpu.h \
|
||||
cpufunc.h db_machdep.h disklabel.h elf_machdep.h endian.h fbio.h \
|
||||
float.h frame.h ieee.h ieeefp.h intr.h kcore.h limits.h mtpr.h \
|
||||
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
|
||||
setjmp.h signal.h stdarg.h svr4_machdep.h trap.h types.h varargs.h \
|
||||
vmparam.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
3
sys/arch/amigappc/include/ansi.h
Normal file
3
sys/arch/amigappc/include/ansi.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ansi.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/ansi.h>
|
3
sys/arch/amigappc/include/aout_machdep.h
Normal file
3
sys/arch/amigappc/include/aout_machdep.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: aout_machdep.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/aout_machdep.h>
|
3
sys/arch/amigappc/include/asm.h
Normal file
3
sys/arch/amigappc/include/asm.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: asm.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/asm.h>
|
3
sys/arch/amigappc/include/bat.h
Normal file
3
sys/arch/amigappc/include/bat.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: bat.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/bat.h>
|
3
sys/arch/amigappc/include/bswap.h
Normal file
3
sys/arch/amigappc/include/bswap.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: bswap.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/bswap.h>
|
289
sys/arch/amigappc/include/bus.h
Normal file
289
sys/arch/amigappc/include/bus.h
Normal file
@ -0,0 +1,289 @@
|
||||
/* $NetBSD: bus.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Leo Weppelman. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Leo Weppelman for the
|
||||
* NetBSD Project.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _AMIGA_BUS_H_
|
||||
#define _AMIGA_BUS_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* Memory addresses (in bus space)
|
||||
*/
|
||||
|
||||
typedef u_int32_t bus_addr_t;
|
||||
typedef u_int32_t bus_size_t;
|
||||
|
||||
/*
|
||||
* Access methods for bus resources and address space.
|
||||
*/
|
||||
typedef struct bus_space_tag *bus_space_tag_t;
|
||||
typedef u_long bus_space_handle_t;
|
||||
|
||||
/*
|
||||
* Lazyness macros for function declarations.
|
||||
*/
|
||||
|
||||
#define bsr(what, typ) \
|
||||
typ (what)(bus_space_tag_t, bus_space_handle_t, bus_size_t)
|
||||
|
||||
#define bsw(what, typ) \
|
||||
void (what)(bus_space_tag_t, bus_space_handle_t, bus_size_t, typ)
|
||||
|
||||
#define bsrm(what, typ) \
|
||||
void (what)(bus_space_tag_t, bus_space_handle_t, bus_size_t, \
|
||||
typ *, bus_size_t)
|
||||
|
||||
#define bswm(what, typ) \
|
||||
void (what)(bus_space_tag_t, bus_space_handle_t, bus_size_t, \
|
||||
const typ *, bus_size_t)
|
||||
|
||||
#define bssr(what, typ) \
|
||||
void (what)(bus_space_tag_t, bus_space_handle_t, bus_size_t, \
|
||||
typ, bus_size_t)
|
||||
|
||||
#define bscr(what, typ) \
|
||||
void (what)(bus_space_tag_t, \
|
||||
bus_space_handle_t, bus_size_t, \
|
||||
bus_space_handle_t, bus_size_t, \
|
||||
bus_size_t)
|
||||
|
||||
/* declarations for _1 functions */
|
||||
|
||||
bsrm(bus_space_read_multi_1, u_int8_t);
|
||||
bswm(bus_space_write_multi_1, u_int8_t);
|
||||
bsrm(bus_space_read_region_1, u_int8_t);
|
||||
bswm(bus_space_write_region_1, u_int8_t);
|
||||
bsrm(bus_space_read_region_stream_1, u_int8_t);
|
||||
bswm(bus_space_write_region_stream_1, u_int8_t);
|
||||
bssr(bus_space_set_region_1, u_int8_t);
|
||||
bscr(bus_space_copy_region_1, u_int8_t);
|
||||
|
||||
/*
|
||||
* Implementation specific structures.
|
||||
* XXX Don't use outside of bus_space definitions!
|
||||
* XXX maybe this should be encapsuled in a non-global .h file?
|
||||
*/
|
||||
|
||||
struct bus_space_tag {
|
||||
bus_addr_t base;
|
||||
u_int8_t stride;
|
||||
u_int8_t dum[3];
|
||||
const struct amiga_bus_space_methods *absm;
|
||||
};
|
||||
|
||||
struct amiga_bus_space_methods {
|
||||
|
||||
/* 16bit methods */
|
||||
|
||||
bsr(*bsr2, u_int16_t);
|
||||
bsw(*bsw2, u_int16_t);
|
||||
bsrm(*bsrm2, u_int16_t);
|
||||
bswm(*bswm2, u_int16_t);
|
||||
bsrm(*bsrr2, u_int16_t);
|
||||
bswm(*bswr2, u_int16_t);
|
||||
bsrm(*bsrrs2, u_int16_t);
|
||||
bswm(*bswrs2, u_int16_t);
|
||||
bssr(*bssr2, u_int16_t);
|
||||
bscr(*bscr2, u_int16_t);
|
||||
|
||||
/* add 32bit methods here */
|
||||
};
|
||||
|
||||
const struct amiga_bus_space_methods amiga_contiguous_methods;
|
||||
const struct amiga_bus_space_methods amiga_interleaved_methods;
|
||||
const struct amiga_bus_space_methods amiga_interleaved_wordaccess_methods;
|
||||
|
||||
/*
|
||||
* Macro definition of map, unmap, etc.
|
||||
*/
|
||||
|
||||
#define bus_space_map(tag,off,size,cache,handle) \
|
||||
(*(handle) = (tag)->base + ((off)<<(tag)->stride), 0)
|
||||
|
||||
#define bus_space_subregion(tag, handle, offset, size, nhandlep) \
|
||||
(*(nhandlep) = (handle) + ((offset)<<(tag)->stride), 0)
|
||||
|
||||
#define bus_space_unmap(tag,handle,size) (void)0
|
||||
|
||||
/*
|
||||
* Macro definition of some _1 functions:
|
||||
*/
|
||||
|
||||
#define bus_space_read_1(t, h, o) \
|
||||
((void) t, (*(volatile u_int8_t *)((h) + ((o)<<(t)->stride))))
|
||||
|
||||
#define bus_space_write_1(t, h, o, v) \
|
||||
((void) t, ((void)(*(volatile u_int8_t *)((h) + ((o)<<(t)->stride)) = (v))))
|
||||
|
||||
/*
|
||||
* Inline definition of other _1 functions:
|
||||
*/
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_read_multi_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
*a = bus_space_read_1(t, h, o);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_write_multi_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
const u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
bus_space_write_1(t, h, o, *a);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_read_region_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
*a = bus_space_read_1(t, h, o++);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_write_region_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
const u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
bus_space_write_1(t, h, o++, *a);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_set_region_1(t, h, o, v, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
u_int8_t v;
|
||||
{
|
||||
while (c--)
|
||||
bus_space_write_1(t, h, o++, v);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_copy_region_1(t, srch, srco, dsth, dsto, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t srch, dsth;
|
||||
bus_size_t srco, dsto, c;
|
||||
{
|
||||
u_int8_t v;
|
||||
|
||||
while (c--) {
|
||||
v = bus_space_read_1(t, srch, srco++);
|
||||
bus_space_write_1(t, dsth, dsto++, v);
|
||||
}
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_read_region_stream_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
*a = bus_space_read_1(t, h, o++);
|
||||
}
|
||||
|
||||
extern __inline__ void
|
||||
bus_space_write_region_stream_1(t, h, o, a, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h;
|
||||
bus_size_t o, c;
|
||||
const u_int8_t *a;
|
||||
{
|
||||
for (; c; a++, c--)
|
||||
bus_space_write_1(t, h, o++, *a);
|
||||
}
|
||||
|
||||
/*
|
||||
* Macro definition of _2 functions as indirect method array calls
|
||||
*/
|
||||
|
||||
#define bus_space_read_2(t, h, o) ((t)->absm->bsr2)((t), (h), (o))
|
||||
#define bus_space_write_2(t, h, o, v) ((t)->absm->bsw2)((t), (h), (o), (v))
|
||||
|
||||
#define bus_space_read_multi_2(t, h, o, p, c) \
|
||||
((t)->absm->bsrm2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_write_multi_2(t, h, o, p, c) \
|
||||
((t)->absm->bswm2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_read_region_2(t, h, o, p, c) \
|
||||
((t)->absm->bsrr2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_write_region_2(t, h, o, p, c) \
|
||||
((t)->absm->bswr2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_read_region_stream_2(t, h, o, p, c) \
|
||||
((t)->absm->bsrrs2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_write_region_stream_2(t, h, o, p, c) \
|
||||
((t)->absm->bswrs2)((t), (h), (o), (p), (c))
|
||||
|
||||
#define bus_space_set_region_2(t, h, o, v, c) \
|
||||
((t)->absm->bssr2)((t), (h), (o), (v), (c))
|
||||
|
||||
#define bus_space_copy_region_2(t, srch, srco, dsth, dsto, c) \
|
||||
((t)->absm->bscr2)((t), (srch), (srco), (dsth), (dsto), (c))
|
||||
|
||||
/*
|
||||
* Bus read/write barrier methods.
|
||||
*
|
||||
* void bus_space_barrier __P((bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* bus_size_t len, int flags));
|
||||
*
|
||||
* Note: the 680x0 does not currently require barriers, but we must
|
||||
* provide the flags to MI code.
|
||||
*/
|
||||
#define bus_space_barrier(t, h, o, l, f) \
|
||||
((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f)))
|
||||
#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */
|
||||
#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */
|
||||
|
||||
#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
|
||||
#endif /* _AMIGA_BUS_H_ */
|
3
sys/arch/amigappc/include/cdefs.h
Normal file
3
sys/arch/amigappc/include/cdefs.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: cdefs.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/cdefs.h>
|
92
sys/arch/amigappc/include/conf.h
Normal file
92
sys/arch/amigappc/include/conf.h
Normal file
@ -0,0 +1,92 @@
|
||||
/* $NetBSD: conf.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Bernd Ernesti. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bernd Ernesti.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define mmread mmrw
|
||||
#define mmwrite mmrw
|
||||
cdev_decl(mm);
|
||||
|
||||
cdev_decl(ctty);
|
||||
|
||||
bdev_decl(fd);
|
||||
cdev_decl(fd);
|
||||
|
||||
/* open, close, ioctl, poll, mmap -- XXX should be a map device */
|
||||
#define cdev_grf_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \
|
||||
(dev_type_write((*))) nullop, dev_init(c,n,ioctl), \
|
||||
(dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
|
||||
dev_init(c,n,mmap) }
|
||||
|
||||
/* open, close, ioctl, poll, mmap -- XXX should be a map device */
|
||||
#define cdev_view_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \
|
||||
(dev_type_write((*))) nullop, dev_init(c,n,ioctl), \
|
||||
(dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
|
||||
dev_init(c,n,mmap) }
|
||||
|
||||
/* open, close, read, write, ioctl -- XXX should be a generic device */
|
||||
#define cdev_par_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
|
||||
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
|
||||
0, (dev_type_poll((*))) enodev, (dev_type_mmap((*))) enodev }
|
||||
|
||||
/* open, close, write, ioctl -- XXX should be a generic device */
|
||||
#define cdev_lpt_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
|
||||
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
|
||||
0, (dev_type_poll((*))) enodev, (dev_type_mmap((*))) enodev }
|
||||
|
||||
cdev_decl(ms);
|
||||
|
||||
cdev_decl(grf);
|
||||
|
||||
cdev_decl(kbd);
|
||||
|
||||
cdev_decl(ite);
|
||||
|
||||
cdev_decl(par);
|
||||
|
||||
cdev_decl(ser);
|
||||
|
||||
cdev_decl(msc);
|
||||
|
||||
cdev_decl(mfcs);
|
||||
|
||||
cdev_decl(com);
|
||||
|
||||
cdev_decl(lpt);
|
||||
|
||||
cdev_decl(view);
|
||||
|
||||
bdev_decl(sw);
|
||||
cdev_decl(sw);
|
||||
|
||||
cdev_decl(scsibus);
|
93
sys/arch/amigappc/include/cpu.h
Normal file
93
sys/arch/amigappc/include/cpu.h
Normal file
@ -0,0 +1,93 @@
|
||||
#ifndef _MACHINE_CPU_H_
|
||||
#define _MACHINE_CPU_H_
|
||||
|
||||
#include <machine/frame.h>
|
||||
#include <machine/psl.h>
|
||||
#include <machine/intr.h>
|
||||
|
||||
u_long clkread __P((void));
|
||||
void physaccess __P((caddr_t, caddr_t, int, int));
|
||||
|
||||
/* ADAM: taken from macppc/cpu.h */
|
||||
#define CLKF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0)
|
||||
#define CLKF_BASEPRI(frame) ((frame)->pri == 0)
|
||||
#define CLKF_PC(frame) ((frame)->srr0)
|
||||
#define CLKF_INTR(frame) ((frame)->depth > 0)
|
||||
|
||||
#define cpu_swapout(p)
|
||||
#define cpu_wait(p)
|
||||
#define cpu_number() 0
|
||||
|
||||
extern void delay __P((unsigned));
|
||||
#define DELAY(n) delay(n)
|
||||
|
||||
extern __volatile int want_resched;
|
||||
extern __volatile int astpending;
|
||||
|
||||
#define need_resched() (want_resched = 1, astpending = 1)
|
||||
#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, astpending = 1)
|
||||
#define signotify(p) (astpending = 1)
|
||||
|
||||
extern char bootpath[];
|
||||
|
||||
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||
#define CACHELINESIZE 32
|
||||
#endif
|
||||
|
||||
/* ADAM: commented out to avoid CTL_MACHDEP_NAMES redefiniton (see below) */
|
||||
/*#include <powerpc/cpu.h>*/
|
||||
|
||||
/* end of ADAM */
|
||||
|
||||
|
||||
/* ADAM: maybe we will need this??? */
|
||||
/* values for machineid (happen to be AFF_* settings of AttnFlags) */
|
||||
/*
|
||||
#define AMIGA_68020 (1L<<1)
|
||||
#define AMIGA_68030 (1L<<2)
|
||||
#define AMIGA_68040 (1L<<3)
|
||||
#define AMIGA_68881 (1L<<4)
|
||||
#define AMIGA_68882 (1L<<5)
|
||||
#define AMIGA_FPU40 (1L<<6)
|
||||
#define AMIGA_68060 (1L<<7)
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL
|
||||
int machineid;
|
||||
#endif
|
||||
|
||||
/* ADAM: copied from powerpc/cpu.h */
|
||||
#ifndef _POWERPC_CPU_H_
|
||||
#define _POWERPC_CPU_H_
|
||||
|
||||
extern void __syncicache __P((void *, int));
|
||||
|
||||
/*
|
||||
* CTL_MACHDEP definitions.
|
||||
*/
|
||||
#define CPU_CACHELINE 1
|
||||
#define CPU_MAXID 2
|
||||
|
||||
#endif /* _POWERPC_CPU_H_ */
|
||||
|
||||
/* ADAM: copied from amiga/cpu.h */
|
||||
#define CTL_MACHDEP_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "console_device", CTLTYPE_STRUCT }, \
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
/*
|
||||
* Prototypes from amiga_init.c
|
||||
*/
|
||||
void *alloc_z2mem __P((long));
|
||||
|
||||
/*
|
||||
* Prototypes from autoconf.c
|
||||
*/
|
||||
int is_a1200 __P((void));
|
||||
int is_a3000 __P((void));
|
||||
int is_a4000 __P((void));
|
||||
#endif
|
||||
|
||||
#endif /* !_MACHINE_CPU_H_ */
|
8
sys/arch/amigappc/include/cpufunc.h
Normal file
8
sys/arch/amigappc/include/cpufunc.h
Normal file
@ -0,0 +1,8 @@
|
||||
/* $NetBSD: cpufunc.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
/*
|
||||
* Functions to provide access to special cpu instructions.
|
||||
*/
|
||||
#ifndef _MACHINE_CPUFUNC_H_
|
||||
#define _MACHINE_CPUFUNC_H_
|
||||
#endif /* !_MACHINE_CPUFUNC_H_ */
|
3
sys/arch/amigappc/include/db_machdep.h
Normal file
3
sys/arch/amigappc/include/db_machdep.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: db_machdep.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/db_machdep.h>
|
205
sys/arch/amigappc/include/disklabel.h
Normal file
205
sys/arch/amigappc/include/disklabel.h
Normal file
@ -0,0 +1,205 @@
|
||||
/* $NetBSD: disklabel.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Christian E. Hopps.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef _MACHINE_DISKLABEL_H_
|
||||
#define _MACHINE_DISKLABEL_H_
|
||||
|
||||
#define LABELSECTOR 0 /* sector containing label */
|
||||
#define LABELOFFSET 64 /* offset of label in sector */
|
||||
#define MAXPARTITIONS 16 /* number of partitions */
|
||||
#define RAW_PART 2 /* raw partition: xx?c */
|
||||
|
||||
/*
|
||||
* describes ados Rigid Disk Blocks
|
||||
* which are used to partition a drive
|
||||
*/
|
||||
#define RDBNULL ((u_long)0xffffffff)
|
||||
|
||||
/*
|
||||
* you will find rdblock somewhere in [0, RDBMAXBLOCKS)
|
||||
*/
|
||||
#define RDB_MAXBLOCKS 16
|
||||
|
||||
struct rdblock {
|
||||
u_long id; /* 'RDSK' */
|
||||
u_long nsumlong; /* number of longs in check sum */
|
||||
u_long chksum; /* simple additive with wrap checksum */
|
||||
u_long hostid; /* scsi target of host */
|
||||
u_long nbytes; /* size of disk blocks */
|
||||
u_long flags;
|
||||
u_long badbhead; /* linked list of badblocks */
|
||||
u_long partbhead; /* linked list of partblocks */
|
||||
u_long fsbhead; /* " " of fsblocks */
|
||||
u_long driveinit;
|
||||
u_long resv1[6]; /* RDBNULL */
|
||||
u_long ncylinders; /* number of cylinders on drive */
|
||||
u_long nsectors; /* number of sectors per track */
|
||||
u_long nheads; /* number of tracks per cylinder */
|
||||
u_long interleave;
|
||||
u_long park; /* only used with st506 i.e. not */
|
||||
u_long resv2[3];
|
||||
u_long wprecomp; /* start cyl for write precomp */
|
||||
u_long reducedwrite; /* start cyl for reduced write current */
|
||||
u_long steprate; /* driver step rate in ?s */
|
||||
u_long resv3[5];
|
||||
u_long rdblowb; /* lowblock of range for rdb's */
|
||||
u_long rdbhighb; /* high block of range for rdb's */
|
||||
u_long lowcyl; /* low cylinder of partition area */
|
||||
u_long highcyl; /* upper cylinder of partition area */
|
||||
u_long secpercyl; /* number of sectors per cylinder */
|
||||
u_long parkseconds; /* zero if no park needed */
|
||||
u_long resv4[2];
|
||||
char diskvendor[8]; /* inquiry stuff */
|
||||
char diskproduct[16]; /* inquiry stuff */
|
||||
char diskrevision[4]; /* inquiry stuff */
|
||||
char contvendor[8]; /* inquiry stuff */
|
||||
char contproduct[16]; /* inquiry stuff */
|
||||
char contrevision[4]; /* inquiry stuff */
|
||||
#if never_use_secsize
|
||||
u_long resv5[0];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#define RDBF_LAST 0x1 /* last drive available */
|
||||
#define RDBF_LASTLUN 0x2 /* last LUN available */
|
||||
#define RDBF_LASTUNIT 0x4 /* last target available */
|
||||
#define RDBF_NORESELECT 0x8 /* do not use reselect */
|
||||
#define RDBF_DISKID 0x10 /* disk id is valid ?? */
|
||||
#define RDBF_CTRLID 0x20 /* ctrl id is valid ?? */
|
||||
#define RDBF_SYNC 0x40 /* drive supports SCSI synchronous mode */
|
||||
|
||||
struct ados_environ {
|
||||
u_long tabsize; /* 0: environ table size */
|
||||
u_long sizeblock; /* 1: n long words in a block */
|
||||
u_long secorg; /* 2: not used must be zero */
|
||||
u_long numheads; /* 3: number of surfaces */
|
||||
u_long secperblk; /* 4: must be 1 */
|
||||
u_long secpertrk; /* 5: blocks per track */
|
||||
u_long resvblocks; /* 6: reserved blocks at start */
|
||||
u_long prefac; /* 7: must be 0 */
|
||||
u_long interleave; /* 8: normally 1 */
|
||||
u_long lowcyl; /* 9: low cylinder of partition */
|
||||
u_long highcyl; /* 10: upper cylinder of partition */
|
||||
u_long numbufs; /* 11: ados: number of buffers */
|
||||
u_long membuftype; /* 12: ados: type of bufmem */
|
||||
u_long maxtrans; /* 13: maxtrans the ctrlr supports */
|
||||
u_long mask; /* 14: mask for valid address */
|
||||
u_long bootpri; /* 15: boot priority for autoboot */
|
||||
u_long dostype; /* 16: filesystem type */
|
||||
u_long baud; /* 17: serial handler baud rate */
|
||||
u_long control; /* 18: control word for fs */
|
||||
u_long bootblocks; /* 19: blocks containing boot code */
|
||||
u_long fsize; /* 20: file system block size */
|
||||
u_long frag; /* 21: allowable frags per block */
|
||||
u_long cpg; /* 22: cylinders per group */
|
||||
};
|
||||
|
||||
struct partblock {
|
||||
u_long id; /* 'PART' */
|
||||
u_long nsumlong; /* number of longs in check sum */
|
||||
u_long chksum; /* simple additive with wrap checksum */
|
||||
u_long hostid; /* scsi target of host */
|
||||
u_long next; /* next in chain */
|
||||
u_long flags; /* see below */
|
||||
u_long resv1[3];
|
||||
u_char partname[32]; /* (BCPL) part name (may not be unique) */
|
||||
u_long resv2[15];
|
||||
struct ados_environ e;
|
||||
#if never_use_secsize
|
||||
u_long extra[9]; /* 8 for extra added to environ */
|
||||
#endif
|
||||
};
|
||||
|
||||
#define PBF_BOOTABLE 0x1 /* partition is bootable */
|
||||
#define PBF_NOMOUNT 0x2 /* partition should be mounted */
|
||||
|
||||
struct badblock {
|
||||
u_long id; /* 'BADB' */
|
||||
u_long nsumlong; /* number of longs in check sum */
|
||||
u_long chksum; /* simple additive with wrap checksum */
|
||||
u_long hostid; /* scsi target of host */
|
||||
u_long next; /* next in chain */
|
||||
u_long resv;
|
||||
struct badblockent {
|
||||
u_long badblock;
|
||||
u_long goodblock;
|
||||
} badtab[0]; /* 61 for secsize == 512 */
|
||||
};
|
||||
|
||||
struct fsblock {
|
||||
u_long id; /* 'FSHD' */
|
||||
u_long nsumlong; /* number of longs in check sum */
|
||||
u_long chksum; /* simple additive with wrap checksum */
|
||||
u_long hostid; /* scsi target of host */
|
||||
u_long next; /* next in chain */
|
||||
u_long flags;
|
||||
u_long resv1[2];
|
||||
u_long dostype; /* this is a file system for this type */
|
||||
u_long version; /* version of this fs */
|
||||
u_long patchflags; /* describes which functions to replace */
|
||||
u_long type; /* zero */
|
||||
u_long task; /* zero */
|
||||
u_long lock; /* zero */
|
||||
u_long handler; /* zero */
|
||||
u_long stacksize; /* to use when loading handler */
|
||||
u_long priority; /* to run the fs at. */
|
||||
u_long startup; /* zero */
|
||||
u_long lsegblocks; /* linked list of lsegblocks of fs code */
|
||||
u_long globalvec; /* bcpl vector not used mostly */
|
||||
#if never_use_secsize
|
||||
u_long resv2[44];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct lsegblock {
|
||||
u_long id; /* 'LSEG' */
|
||||
u_long nsumlong; /* number of longs in check sum */
|
||||
u_long chksum; /* simple additive with wrap checksum */
|
||||
u_long hostid; /* scsi target of host */
|
||||
u_long next; /* next in chain */
|
||||
u_long loaddata[0]; /* load segment data, 123 for secsize == 512 */
|
||||
};
|
||||
|
||||
#define RDBLOCK_ID 0x5244534b /* 'RDSK' */
|
||||
#define PARTBLOCK_ID 0x50415254 /* 'PART' */
|
||||
#define BADBLOCK_ID 0x42414442 /* 'BADB' */
|
||||
#define FSBLOCK_ID 0x46534844 /* 'FSHD' */
|
||||
#define LSEGBLOCK_ID 0x4c534547 /* 'LSEG' */
|
||||
|
||||
struct cpu_disklabel {
|
||||
u_long rdblock; /* may be RDBNULL which invalidates */
|
||||
u_long pblist[MAXPARTITIONS]; /* partblock number (RDB list order) */
|
||||
int pbindex[MAXPARTITIONS]; /* index of pblock (partition order) */
|
||||
int valid; /* essential that this is valid */
|
||||
};
|
||||
|
||||
#endif /* _MACHINE_DISKLABEL_H_ */
|
3
sys/arch/amigappc/include/elf_machdep.h
Normal file
3
sys/arch/amigappc/include/elf_machdep.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: elf_machdep.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/elf_machdep.h>
|
3
sys/arch/amigappc/include/endian.h
Normal file
3
sys/arch/amigappc/include/endian.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: endian.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/endian.h>
|
3
sys/arch/amigappc/include/endian_machdep.h
Normal file
3
sys/arch/amigappc/include/endian_machdep.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: endian_machdep.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/endian_machdep.h>
|
46
sys/arch/amigappc/include/fbio.h
Normal file
46
sys/arch/amigappc/include/fbio.h
Normal file
@ -0,0 +1,46 @@
|
||||
/* $NetBSD: fbio.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Ignatios Souvatzis.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FBIO compatible video control.
|
||||
*/
|
||||
#define FBVIDEO_OFF 0
|
||||
#define FBVIDEO_ON 1
|
||||
|
||||
#define FBIOSVIDEO _IOW('F', 7, int)
|
||||
#define FBIOGVIDEO _IOR('F', 8, int)
|
3
sys/arch/amigappc/include/float.h
Normal file
3
sys/arch/amigappc/include/float.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: float.h,v 1.1 2000/05/25 22:11:59 is Exp $ */
|
||||
|
||||
#include <powerpc/float.h>
|
3
sys/arch/amigappc/include/fpu.h
Normal file
3
sys/arch/amigappc/include/fpu.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: fpu.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/fpu.h>
|
3
sys/arch/amigappc/include/frame.h
Normal file
3
sys/arch/amigappc/include/frame.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: frame.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/frame.h>
|
98
sys/arch/amigappc/include/hid.h
Normal file
98
sys/arch/amigappc/include/hid.h
Normal file
@ -0,0 +1,98 @@
|
||||
/* $NetBSD: hid.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 Adam Ciarcinski.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Adam Ciarcinski for
|
||||
* the NetBSD project.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* 603e/604e/750 HID0 */
|
||||
#define HID0_EMCP 0x80000000
|
||||
#define HID0_DBP 0x40000000
|
||||
#define HID0_EBA 0x20000000
|
||||
#define HID0_EBD 0x10000000
|
||||
#define HID0_BCLK 0x08000000
|
||||
#define HID0_EICE 0x04000000
|
||||
#define HID0_ECLK 0x02000000
|
||||
#define HID0_PAR 0x01000000
|
||||
#define HID0_DOZE 0x00800000
|
||||
#define HID0_NAP 0x00400000
|
||||
#define HID0_SLEEP 0x00200000
|
||||
#define HID0_DPM 0x00100000
|
||||
#define HID0_RISEG 0x00080000
|
||||
|
||||
#define HID0_NHR 0x00010000
|
||||
#define HID0_ICE 0x00008000
|
||||
#define HID0_DCE 0x00004000
|
||||
#define HID0_ILOCK 0x00002000
|
||||
#define HID0_DLOCK 0x00001000
|
||||
#define HID0_ICFI 0x00000800
|
||||
#define HID0_DCFI 0x00000400
|
||||
#define HID0_SPD 0x00000200
|
||||
#define HID0_IFEM 0x00000100
|
||||
#define HID0_SGE 0x00000080
|
||||
#define HID0_DCFA 0x00000040
|
||||
#define HID0_BTIC 0x00000020
|
||||
#define HID0_FBIOB 0x00000010
|
||||
#define HID0_ABE 0x00000008
|
||||
#define HID0_BHT 0x00000004
|
||||
#define HID0_BTACD 0x00000002
|
||||
#define HID0_NOOPTI 0x00000001
|
||||
|
||||
/* 603e/604e/750 HID0 */
|
||||
#define HID0_EMCP 0x80000000
|
||||
#define HID0_DBP 0x40000000
|
||||
#define HID0_EBA 0x20000000
|
||||
#define HID0_EBD 0x10000000
|
||||
#define HID0_BCLK 0x08000000
|
||||
#define HID0_EICE 0x04000000
|
||||
#define HID0_ECLK 0x02000000
|
||||
#define HID0_PAR 0x01000000
|
||||
#define HID0_DOZE 0x00800000
|
||||
#define HID0_NAP 0x00400000
|
||||
#define HID0_SLEEP 0x00200000
|
||||
#define HID0_DPM 0x00100000
|
||||
#define HID0_RISEG 0x00080000
|
||||
|
||||
#define HID0_NHR 0x00010000
|
||||
#define HID0_ICE 0x00008000
|
||||
#define HID0_DCE 0x00004000
|
||||
#define HID0_ILOCK 0x00002000
|
||||
#define HID0_DLOCK 0x00001000
|
||||
#define HID0_ICFI 0x00000800
|
||||
#define HID0_DCFI 0x00000400
|
||||
#define HID0_SPD 0x00000200
|
||||
#define HID0_IFEM 0x00000100
|
||||
#define HID0_SGE 0x00000080
|
||||
#define HID0_DCFA 0x00000040
|
||||
#define HID0_BTIC 0x00000020
|
||||
#define HID0_FBIOB 0x00000010
|
||||
#define HID0_ABE 0x00000008
|
||||
#define HID0_BHT 0x00000004
|
||||
#define HID0_BTACD 0x00000002
|
||||
#define HID0_NOOPTI 0x00000001
|
3
sys/arch/amigappc/include/ieee.h
Normal file
3
sys/arch/amigappc/include/ieee.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ieee.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/ieee.h>
|
3
sys/arch/amigappc/include/ieeefp.h
Normal file
3
sys/arch/amigappc/include/ieeefp.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ieeefp.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/ieeefp.h>
|
247
sys/arch/amigappc/include/intr.h
Normal file
247
sys/arch/amigappc/include/intr.h
Normal file
@ -0,0 +1,247 @@
|
||||
/* $NetBSD: intr.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Ignatios Souvatzis.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* machine/intr.h for the Amiga port.
|
||||
* Currently, only a wrapper, for most of the stuff, around the old
|
||||
* include files.
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_INTR_H_
|
||||
#define _MACHINE_INTR_H_
|
||||
|
||||
#include <amiga/amiga/isr.h>
|
||||
#include <amiga/include/mtpr.h>
|
||||
|
||||
#define __GENERIC_SOFT_INTERRUPTS
|
||||
/* ADAM: commented out
|
||||
#define IPL_SOFTSERIAL 1
|
||||
#define IPL_SOFTNET 1
|
||||
*/
|
||||
|
||||
#ifdef splaudio
|
||||
#undef splaudio
|
||||
#define splaudio spl6
|
||||
#endif
|
||||
|
||||
#define spllpt() spl6()
|
||||
|
||||
/* ADAM: from macppc/intr.h */
|
||||
/* Interrupt priority `levels'. */
|
||||
#define IPL_NONE 9 /* nothing */
|
||||
#define IPL_SOFTCLOCK 8 /* timeouts */
|
||||
#define IPL_SOFTNET 7 /* protocol stacks */
|
||||
#define IPL_BIO 6 /* block I/O */
|
||||
#define IPL_NET 5 /* network */
|
||||
#define IPL_SOFTSERIAL 4 /* serial */
|
||||
#define IPL_TTY 3 /* terminal */
|
||||
#define IPL_IMP 3 /* memory allocation */
|
||||
#define IPL_AUDIO 2 /* audio */
|
||||
#define IPL_CLOCK 1 /* clock */
|
||||
#define IPL_HIGH 1 /* everything */
|
||||
#define IPL_SERIAL 0 /* serial */
|
||||
#define NIPL 10
|
||||
|
||||
/* Interrupt sharing types. */
|
||||
#define IST_NONE 0 /* none */
|
||||
#define IST_PULSE 1 /* pulsed */
|
||||
#define IST_EDGE 2 /* edge-triggered */
|
||||
#define IST_LEVEL 3 /* level-triggered */
|
||||
|
||||
#ifndef _LOCORE
|
||||
|
||||
/*
|
||||
* Interrupt handler chains. intr_establish() inserts a handler into
|
||||
* the list. The handler is called with its (single) argument.
|
||||
*/
|
||||
struct intrhand {
|
||||
int (*ih_fun) __P((void *));
|
||||
void *ih_arg;
|
||||
u_long ih_count;
|
||||
struct intrhand *ih_next;
|
||||
int ih_level;
|
||||
int ih_irq;
|
||||
};
|
||||
|
||||
/*
|
||||
void setsoftclock __P((void));
|
||||
*/
|
||||
void clearsoftclock __P((void));
|
||||
int splsoftclock __P((void));
|
||||
/*
|
||||
void setsoftnet __P((void));
|
||||
*/
|
||||
void clearsoftnet __P((void));
|
||||
int splsoftnet __P((void));
|
||||
|
||||
void do_pending_int __P((void));
|
||||
|
||||
static __inline int splraise __P((int));
|
||||
static __inline int spllower __P((int));
|
||||
static __inline void splx __P((int));
|
||||
static __inline void softintr __P((int));
|
||||
|
||||
/*
|
||||
extern volatile int cpl, ipending, astpending, tickspending;
|
||||
*/
|
||||
extern int imask[];
|
||||
|
||||
/*
|
||||
* Reorder protection in the following inline functions is
|
||||
* achived with the "eieio" instruction which the assembler
|
||||
* seems to detect and then doen't move instructions past....
|
||||
*/
|
||||
static __inline int
|
||||
splraise(ncpl)
|
||||
int ncpl;
|
||||
{
|
||||
int ocpl;
|
||||
|
||||
__asm__ volatile("sync; eieio\n"); /* don't reorder.... */
|
||||
/*
|
||||
ocpl = cpl;
|
||||
cpl = ocpl | ncpl;
|
||||
*/
|
||||
__asm__ volatile("sync; eieio\n"); /* reorder protect */
|
||||
return (ocpl);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
splx(ncpl)
|
||||
int ncpl;
|
||||
{
|
||||
|
||||
__asm__ volatile("sync; eieio\n"); /* reorder protect */
|
||||
/*
|
||||
cpl = ncpl;
|
||||
if (ipending & ~ncpl)
|
||||
do_pending_int();
|
||||
*/
|
||||
__asm__ volatile("sync; eieio\n"); /* reorder protect */
|
||||
}
|
||||
|
||||
static __inline int
|
||||
spllower(ncpl)
|
||||
int ncpl;
|
||||
{
|
||||
int ocpl;
|
||||
|
||||
__asm__ volatile("sync; eieio\n"); /* reorder protect */
|
||||
/*
|
||||
ocpl = cpl;
|
||||
cpl = ncpl;
|
||||
if (ipending & ~ncpl)
|
||||
do_pending_int();
|
||||
*/
|
||||
__asm__ volatile("sync; eieio\n"); /* reorder protect */
|
||||
return (ocpl);
|
||||
}
|
||||
|
||||
/* Following code should be implemented with lwarx/stwcx to avoid
|
||||
* the disable/enable. i need to read the manual once more.... */
|
||||
static __inline void
|
||||
softintr(ipl)
|
||||
int ipl;
|
||||
{
|
||||
int msrsave;
|
||||
|
||||
__asm__ volatile("mfmsr %0" : "=r"(msrsave));
|
||||
__asm__ volatile("mtmsr %0" :: "r"(msrsave & ~PSL_EE));
|
||||
// ipending |= 1 << ipl;
|
||||
__asm__ volatile("mtmsr %0" :: "r"(msrsave));
|
||||
}
|
||||
|
||||
#define ICU_LEN 32
|
||||
|
||||
/* Soft interrupt masks. */
|
||||
/*
|
||||
#define SIR_CLOCK 28
|
||||
#define SIR_NET 29
|
||||
#define SIR_SERIAL 30
|
||||
*/
|
||||
#define SPL_CLOCK 31
|
||||
|
||||
/*
|
||||
* Hardware interrupt masks
|
||||
*/
|
||||
#define splbio() splraise(imask[IPL_BIO])
|
||||
#define splnet() splraise(imask[IPL_NET])
|
||||
#define spltty() splraise(imask[IPL_TTY])
|
||||
#define splaudio() splraise(imask[IPL_AUDIO])
|
||||
#define splclock() splraise(imask[IPL_CLOCK])
|
||||
#define splstatclock() splclock()
|
||||
#define splserial() splraise(imask[IPL_SERIAL])
|
||||
|
||||
/* ADAM: see above
|
||||
#define spllpt() spltty()
|
||||
*/
|
||||
|
||||
/*
|
||||
* Software interrupt masks
|
||||
*
|
||||
* NOTE: splsoftclock() is used by hardclock() to lower the priority from
|
||||
* clock to softclock before it calls softclock().
|
||||
*/
|
||||
#define spllowersoftclock() spllower(imask[IPL_SOFTCLOCK])
|
||||
#define splsoftclock() splraise(imask[IPL_SOFTCLOCK])
|
||||
#define splsoftnet() splraise(imask[IPL_SOFTNET])
|
||||
#define splsoftserial() splraise(imask[IPL_SOFTSERIAL])
|
||||
|
||||
/*
|
||||
* Miscellaneous
|
||||
*/
|
||||
#define splimp() splraise(imask[IPL_IMP])
|
||||
#define splhigh() splraise(imask[IPL_HIGH])
|
||||
#define spl0() spllower(0)
|
||||
|
||||
/*
|
||||
#define setsoftclock() softintr(SIR_CLOCK)
|
||||
#define setsoftnet() softintr(SIR_NET)
|
||||
#define setsoftserial() softintr(SIR_SERIAL)
|
||||
*/
|
||||
extern long intrcnt[];
|
||||
|
||||
#define CNT_IRQ0 0
|
||||
#define CNT_CLOCK 64
|
||||
#define CNT_SOFTCLOCK 65
|
||||
#define CNT_SOFTNET 66
|
||||
#define CNT_SOFTSERIAL 67
|
||||
|
||||
#endif /* !_LOCORE */
|
||||
|
||||
#endif /* !_MACPPC_INTR_H_ */
|
3
sys/arch/amigappc/include/ipkdb.h
Normal file
3
sys/arch/amigappc/include/ipkdb.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ipkdb.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/ipkdb.h>
|
3
sys/arch/amigappc/include/kcore.h
Normal file
3
sys/arch/amigappc/include/kcore.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: kcore.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/kcore.h>
|
3
sys/arch/amigappc/include/limits.h
Normal file
3
sys/arch/amigappc/include/limits.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: limits.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/limits.h>
|
3
sys/arch/amigappc/include/lock.h
Normal file
3
sys/arch/amigappc/include/lock.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: lock.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/lock.h>
|
3
sys/arch/amigappc/include/machine_type.h
Normal file
3
sys/arch/amigappc/include/machine_type.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: machine_type.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/machine_type.h>
|
96
sys/arch/amigappc/include/mtpr.h
Normal file
96
sys/arch/amigappc/include/mtpr.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* $NetBSD: mtpr.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: mtpr.h 1.1 90/07/09$
|
||||
*
|
||||
* @(#)mtpr.h 7.2 (Berkeley) 11/3/90
|
||||
*/
|
||||
#ifndef _MACHINE_MPTR_H_
|
||||
#define _MACHINE_MPTR_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
/*
|
||||
* simulated software interrupt register (extends hardware
|
||||
* SOFTINT bit)
|
||||
*/
|
||||
|
||||
/*
|
||||
* this makes it pretty machine dependant. Should this go into
|
||||
* <amiga/amiga/mtpr.h> ?
|
||||
*/
|
||||
#include <amiga/amiga/custom.h>
|
||||
#ifdef DRACO
|
||||
#include <amiga/amiga/drcustom.h>
|
||||
#include <m68k/include/asm_single.h>
|
||||
#endif
|
||||
|
||||
extern unsigned char ssir;
|
||||
|
||||
#define SIR_NET 0x1 /* call netintr */
|
||||
#define SIR_CLOCK 0x2 /* call softclock */
|
||||
#define SIR_CBACK 0x4 /* walk the sicallback-chain */
|
||||
|
||||
#define siroff(x) ssir &= ~(x)
|
||||
#ifdef DRACO
|
||||
#define setsoftint() do { if (is_draco()) \
|
||||
single_inst_bset_b(*draco_intfrc, DRIRQ_SOFT); \
|
||||
else \
|
||||
custom.intreq = INTF_SETCLR|INTF_SOFTINT; \
|
||||
} while (0)
|
||||
#define clrsoftint() do { if (is_draco()) \
|
||||
single_inst_bclr_b(*draco_intfrc, DRIRQ_SOFT); \
|
||||
else \
|
||||
custom.intreq = INTF_SOFTINT; \
|
||||
} while (0)
|
||||
#else
|
||||
#define setsoftint() do {custom.intreq = INTF_SETCLR|INTF_SOFTINT;} while (0)
|
||||
#define clrsoftint() do {custom.intreq = INTF_SOFTINT;} while (0)
|
||||
#endif
|
||||
|
||||
#define setsoftnet() do {ssir |= SIR_NET; setsoftint(); } while (0)
|
||||
#define setsoftclock() do {ssir |= SIR_CLOCK; setsoftint(); } while (0)
|
||||
#define setsoftcback() do {ssir |= SIR_CBACK; setsoftint(); } while (0)
|
||||
|
||||
void softintr_schedule __P((void *));
|
||||
void *softintr_establish __P((int, void (*)(void *), void *));
|
||||
void softintr_disestablish __P((void *));
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_MACHINE_MPTR_H_ */
|
96
sys/arch/amigappc/include/p5reg.h
Normal file
96
sys/arch/amigappc/include/p5reg.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* $NetBSD: p5reg.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 Adam Ciarcinski.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Adam Ciarcinski for
|
||||
* the NetBSD project.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _P5REG_H_
|
||||
#define _P5REG_H_
|
||||
|
||||
#define P5BASE 0xf60000
|
||||
|
||||
/* registers */
|
||||
#define P5_REG_RESET 0x00
|
||||
#define P5_REG_ENABLE 0x08
|
||||
#define P5_REG_WAITSTATE 0x10
|
||||
#define P5_REG_SHADOW 0x18
|
||||
#define P5_REG_LOCK 0x20
|
||||
#define P5_REG_INT 0x28
|
||||
#define P5_IPL_EMU 0x30
|
||||
#define P5_INT_LVL 0x38
|
||||
|
||||
/* bit definitions */
|
||||
#define P5_SET_CLEAR 0x80
|
||||
|
||||
/* REQ_RESET */
|
||||
#define P5_PPC_RESET 0x10
|
||||
#define P5_M68K_RESET 0x08
|
||||
#define P5_AMIGA_RESET 0x04
|
||||
#define P5_AUX_RESET 0x02
|
||||
#define P5_SCSI_RESET 0x01
|
||||
|
||||
/* REG_WAITSTATE */
|
||||
#define P5_PPC_WRITE 0x08
|
||||
#define P5_PPC_READ 0x04
|
||||
#define P5_M68K_WRITE 0x02
|
||||
#define P5_M68K_READ 0x01
|
||||
|
||||
/* REG_SHADOW */
|
||||
#define P5_SELF_RESET 0x40
|
||||
#define P5_SHADOW 0x01
|
||||
|
||||
/* REG_LOCK */
|
||||
#define P5_MAGIC1 0x40
|
||||
#define P5_MAGIC2 0x20
|
||||
#define P5_MAGIC3 0x10
|
||||
|
||||
/* REG_INT */
|
||||
#define P5_ENABLE_IPL 0x02
|
||||
#define P5_INT_MASTER 0x01
|
||||
|
||||
/* IPL_EMU */
|
||||
#define P5_DISABLE_INT 0x40
|
||||
#define P5_M68K_IPL2 0x20
|
||||
#define P5_M68K_IPL1 0x10
|
||||
#define P5_M68K_IPL0 0x08
|
||||
#define P5_PPC_IPL2 0x04
|
||||
#define P5_PPC_IPL1 0x02
|
||||
#define P5_PPC_IPL0 0x01
|
||||
|
||||
/* INT_LVL */
|
||||
#define P5_LVL7 0x40
|
||||
#define P5_LVL6 0x20
|
||||
#define P5_LVL5 0x10
|
||||
#define P5_LVL4 0x08
|
||||
#define P5_LVL3 0x04
|
||||
#define P5_LVL2 0x02
|
||||
#define P5_LVL1 0x01
|
||||
|
||||
#endif /* _P5REG_H_ */
|
167
sys/arch/amigappc/include/param.h
Normal file
167
sys/arch/amigappc/include/param.h
Normal file
@ -0,0 +1,167 @@
|
||||
/* $NetBSD: param.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: machparam.h 1.11 89/08/14$
|
||||
*
|
||||
* @(#)param.h 7.8 (Berkeley) 6/28/91
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_PARAM_H_
|
||||
#define _MACHINE_PARAM_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef _LOCORE
|
||||
#include <machine/cpu.h>
|
||||
#endif /* _LOCORE */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Machine dependent constants for Amiga PowerPC (32-bit only currently)
|
||||
*/
|
||||
#define MACHINE "amigappc"
|
||||
#define MACHINE_ARCH "powerpc"
|
||||
#define MID_MACHINE MID_POWERPC
|
||||
|
||||
#define ALIGNBYTES (sizeof(double) - 1)
|
||||
#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) & ~ALIGNBYTES)
|
||||
#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)
|
||||
|
||||
#define PGSHIFT 12
|
||||
#define NBPG (1 << PGSHIFT) /* Page size */
|
||||
#define PGOFSET (NBPG - 1)
|
||||
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
#define DEV_BSIZE (1 << DEV_BSHIFT)
|
||||
#define BLKDEV_IOSIZE NBPG
|
||||
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
|
||||
|
||||
#define UPAGES 4
|
||||
#define USPACE (UPAGES * NBPG)
|
||||
|
||||
#ifndef MSGBUFSIZE
|
||||
#define MSGBUFSIZE NBPG /* default message buffer size */
|
||||
#endif
|
||||
|
||||
#define KERNBASE 0x00000000 /* start of kernel virtual */
|
||||
|
||||
/*
|
||||
* Constants related to network buffer management.
|
||||
* MCLBYTES must be no larger than NBPG (the software page size), and,
|
||||
* on machines that exchange pages of input or output buffers with mbuf
|
||||
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
|
||||
* of the hardware page size.
|
||||
*/
|
||||
#define MSIZE 128 /* size of an mbuf */
|
||||
#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
|
||||
#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
|
||||
|
||||
#ifndef NMBCLUSTERS
|
||||
|
||||
#if defined(_KERNEL) && !defined(_LKM)
|
||||
#include "opt_gateway.h"
|
||||
#endif /* _KERNEL && ! _LKM */
|
||||
|
||||
#ifdef GATEWAY
|
||||
#define NMBCLUSTERS 512 /* map size, max cluster allocation */
|
||||
#else
|
||||
#define NMBCLUSTERS 256 /* map size, max cluster allocation */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
|
||||
* logical pages.
|
||||
*/
|
||||
#define NKMEMPAGES_MIN_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
|
||||
#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
|
||||
|
||||
/*
|
||||
* pages ("clicks") to disk blocks
|
||||
*/
|
||||
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
|
||||
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
|
||||
/*
|
||||
* bytes to pages
|
||||
*/
|
||||
#define ctob(x) ((x) << PGSHIFT)
|
||||
#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
|
||||
|
||||
/*
|
||||
* bytes to disk blocks
|
||||
*/
|
||||
#define dbtob(x) ((x) << DEV_BSHIFT)
|
||||
#define btodb(x) ((x) >> DEV_BSHIFT)
|
||||
|
||||
/*
|
||||
* Segment handling stuff
|
||||
*/
|
||||
#define SEGMENT_LENGTH 0x10000000
|
||||
#define SEGMENT_MASK 0xf0000000
|
||||
|
||||
/*
|
||||
* Fixed segments
|
||||
*/
|
||||
#define USER_SR 13
|
||||
#define KERNEL_SR 14
|
||||
#define KERNEL_SEGMENT (0xf0000 + KERNEL_SR)
|
||||
#define EMPTY_SEGMENT 0xfffff0
|
||||
#define USER_ADDR ((void *)(USER_SR << ADDR_SR_SHFT))
|
||||
|
||||
/*
|
||||
* Some system constants
|
||||
*/
|
||||
#ifndef NPMAPS
|
||||
#define NPMAPS 32768 /* Number of pmaps in system */
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
/*
|
||||
* point to the custom.intenar and custom.intenaw respectively.
|
||||
extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
|
||||
*/
|
||||
|
||||
/* ADAM: redefiniton of cpu.h */
|
||||
/*
|
||||
#ifndef _LOCORE
|
||||
void delay __P((int));
|
||||
void DELAY __P((int));
|
||||
#endif*/ /* !_LOCORE */
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* def _MACHINE_PARAM_H_ */
|
3
sys/arch/amigappc/include/pcb.h
Normal file
3
sys/arch/amigappc/include/pcb.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: pcb.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/pcb.h>
|
3
sys/arch/amigappc/include/pmap.h
Normal file
3
sys/arch/amigappc/include/pmap.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: pmap.h,v 1.1 2000/05/25 22:12:00 is Exp $ */
|
||||
|
||||
#include <powerpc/pmap.h>
|
58
sys/arch/amigappc/include/powerpc.h
Normal file
58
sys/arch/amigappc/include/powerpc.h
Normal file
@ -0,0 +1,58 @@
|
||||
/* $NetBSD: powerpc.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1996 Wolfgang Solfrank.
|
||||
* Copyright (C) 1996 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by TooLs GmbH.
|
||||
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef _MACHINE_POWERPC_H_
|
||||
#define _MACHINE_POWERPC_H_
|
||||
|
||||
struct mem_region {
|
||||
paddr_t start;
|
||||
psize_t size;
|
||||
};
|
||||
|
||||
void mem_regions __P((struct mem_region **, struct mem_region **));
|
||||
|
||||
/*
|
||||
* These two functions get used solely in boot() in machdep.c.
|
||||
*
|
||||
* Not sure whether boot itself should be implementation dependent instead. XXX
|
||||
*/
|
||||
void ppc_exit __P((void)) __attribute__((__noreturn__));
|
||||
void ppc_boot __P((char *bootspec)) __attribute__((__noreturn__));
|
||||
|
||||
int dk_match __P((char *name));
|
||||
|
||||
void ofrootfound __P((void));
|
||||
|
||||
extern struct device *booted_device;
|
||||
extern int booted_partition;
|
||||
|
||||
#endif /* _MACHINE_POWERPC_H_ */
|
3
sys/arch/amigappc/include/proc.h
Normal file
3
sys/arch/amigappc/include/proc.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: proc.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/proc.h>
|
3
sys/arch/amigappc/include/profile.h
Normal file
3
sys/arch/amigappc/include/profile.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: profile.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/profile.h>
|
5
sys/arch/amigappc/include/psl.h
Normal file
5
sys/arch/amigappc/include/psl.h
Normal file
@ -0,0 +1,5 @@
|
||||
/* $NetBSD: psl.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#define spl3() spl0() /* XXXX ???? */
|
||||
|
||||
#include <powerpc/psl.h>
|
3
sys/arch/amigappc/include/pte.h
Normal file
3
sys/arch/amigappc/include/pte.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: pte.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/pte.h>
|
3
sys/arch/amigappc/include/ptrace.h
Normal file
3
sys/arch/amigappc/include/ptrace.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ptrace.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/ptrace.h>
|
3
sys/arch/amigappc/include/reg.h
Normal file
3
sys/arch/amigappc/include/reg.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: reg.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/reg.h>
|
3
sys/arch/amigappc/include/reloc.h
Normal file
3
sys/arch/amigappc/include/reloc.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: reloc.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/reloc.h>
|
3
sys/arch/amigappc/include/setjmp.h
Normal file
3
sys/arch/amigappc/include/setjmp.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: setjmp.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/setjmp.h>
|
3
sys/arch/amigappc/include/signal.h
Normal file
3
sys/arch/amigappc/include/signal.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: signal.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/signal.h>
|
3
sys/arch/amigappc/include/stdarg.h
Normal file
3
sys/arch/amigappc/include/stdarg.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: stdarg.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/stdarg.h>
|
9
sys/arch/amigappc/include/svr4_machdep.h
Normal file
9
sys/arch/amigappc/include/svr4_machdep.h
Normal file
@ -0,0 +1,9 @@
|
||||
/* $NetBSD: svr4_machdep.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#ifndef _MACHINE_SVR4_MACHDEP_H_
|
||||
#define _MACHINE_SVR4_MACHDEP_H_
|
||||
|
||||
/* There is nothing like... */
|
||||
/*#include <powerpc/svr4_machdep.h>*/
|
||||
|
||||
#endif
|
11
sys/arch/amigappc/include/trap.h
Normal file
11
sys/arch/amigappc/include/trap.h
Normal file
@ -0,0 +1,11 @@
|
||||
/* $NetBSD: trap.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#ifndef _MACHINE_TRAP_H_
|
||||
#define _MACHINE_TRAP_H_
|
||||
|
||||
#include <powerpc/trap.h>
|
||||
|
||||
/* offset when MSR[IP] is set */
|
||||
#define EXC_UPPER 0xfff00000
|
||||
|
||||
#endif /* _MACHINE_TRAP_H_ */
|
3
sys/arch/amigappc/include/types.h
Normal file
3
sys/arch/amigappc/include/types.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: types.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/types.h>
|
3
sys/arch/amigappc/include/varargs.h
Normal file
3
sys/arch/amigappc/include/varargs.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: varargs.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
#include <powerpc/varargs.h>
|
112
sys/arch/amigappc/include/vmparam.h
Normal file
112
sys/arch/amigappc/include/vmparam.h
Normal file
@ -0,0 +1,112 @@
|
||||
/* $NetBSD: vmparam.h,v 1.1 2000/05/25 22:12:01 is Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
* Copyright (C) 1995, 1996 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by TooLs GmbH.
|
||||
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_VMPARAM_H_
|
||||
#define _MACHINE_VMPARAM_H_
|
||||
|
||||
#define USRTEXT NBPG
|
||||
#define USRSTACK VM_MAXUSER_ADDRESS
|
||||
|
||||
#ifndef MAXTSIZ
|
||||
#define MAXTSIZ (16*1024*1024) /* max text size */
|
||||
#endif
|
||||
|
||||
#ifndef DFLDSIZ
|
||||
#define DFLDSIZ (32*1024*1024) /* default data size */
|
||||
#endif
|
||||
|
||||
#ifndef MAXDSIZ
|
||||
#define MAXDSIZ (512*1024*1024) /* max data size */
|
||||
#endif
|
||||
|
||||
#ifndef DFLSSIZ
|
||||
#define DFLSSIZ (1*1024*1024) /* default stack size */
|
||||
#endif
|
||||
|
||||
#ifndef MAXSSIZ
|
||||
#define MAXSSIZ (32*1024*1024) /* max stack size */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Size of shared memory map
|
||||
*/
|
||||
#ifndef SHMMAXPGS
|
||||
#define SHMMAXPGS 1024
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Size of User Raw I/O map
|
||||
*/
|
||||
#define USRIOSIZE 1024
|
||||
|
||||
/*
|
||||
* The time for a process to be blocked before being very swappable.
|
||||
* This is a number of seconds which the system takes as being a non-trivial
|
||||
* amount of real time. You probably shouldn't change this;
|
||||
* it is used in subtle ways (fractions and multiples of it are, that is, like
|
||||
* half of a ``long time'', almost a long time, etc.)
|
||||
* It is related to human patience and other factors which don't really
|
||||
* change over time.
|
||||
*/
|
||||
#define MAXSLP 20
|
||||
|
||||
/*
|
||||
* Would like to have MAX addresses = 0, but this doesn't (currently) work
|
||||
*/
|
||||
#define VM_MIN_ADDRESS ((vaddr_t)0)
|
||||
#define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000)
|
||||
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
|
||||
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)(KERNEL_SR << ADDR_SR_SHFT))
|
||||
#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + SEGMENT_LENGTH - 1)
|
||||
|
||||
/* XXX max. amount of KVM to be used by buffers. */
|
||||
#ifndef VM_MAX_KERNEL_BUF
|
||||
#define VM_MAX_KERNEL_BUF (SEGMENT_LENGTH * 7 / 10)
|
||||
#endif
|
||||
|
||||
#define VM_KMEM_SIZE (NKMEMCLUSTERS * NBPG)
|
||||
#define VM_PHYS_SIZE (USRIOSIZE * NBPG)
|
||||
|
||||
struct pmap_physseg {
|
||||
struct pv_entry *pvent;
|
||||
char *attrs;
|
||||
};
|
||||
|
||||
#define VM_PHYSSEG_MAX 16 /* 1? */
|
||||
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
|
||||
#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
|
||||
|
||||
#define VM_NFREELIST 1
|
||||
#define VM_FREELIST_DEFAULT 0
|
||||
|
||||
#endif /* _MACHINE_VMPARAM_H_ */
|
Loading…
Reference in New Issue
Block a user