diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-01-18 21:49:12 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-01-18 21:49:12 +0000 |
commit | 7225d7141835b9cb38f6ca9f1a090e1e6046ae70 (patch) | |
tree | af77aa0d25b898861e47dafdab8d13130b44fdca /sys/arch/mvme88k/stand | |
parent | acc54ef8a8fd81e473597b8daa2a19704f52599f (diff) |
Define HEAP_START so that we can use space below it for ethernet buffers;
this prevents if_ie buffers from possibly overwriting the stack.
Crank bootloader versions.
Diffstat (limited to 'sys/arch/mvme88k/stand')
-rw-r--r-- | sys/arch/mvme88k/stand/Makefile.inc | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootsd/version.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootst/version.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/if_ie.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/if_le.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/if_lereg.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/version.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/tftpboot/version.c | 5 |
8 files changed, 26 insertions, 19 deletions
diff --git a/sys/arch/mvme88k/stand/Makefile.inc b/sys/arch/mvme88k/stand/Makefile.inc index c92f766a57d..0cefb409fd9 100644 --- a/sys/arch/mvme88k/stand/Makefile.inc +++ b/sys/arch/mvme88k/stand/Makefile.inc @@ -1,10 +1,12 @@ -# $OpenBSD: Makefile.inc,v 1.10 2006/05/16 22:52:07 miod Exp $ +# $OpenBSD: Makefile.inc,v 1.11 2009/01/18 21:49:09 miod Exp $ MDEC_DIR?=/usr/mdec CFLAGS+=-Wall -Werror -fno-stack-protector -mmemcpy +CFLAGS+=-DHEAP_START=${HEAP_START} # Load addresses for first and second stage bootstraps -STAGE1_RELOC=0x009F0000 -STAGE2_RELOC=0x00AF0000 - +STAGE1_RELOC= 0x009f0000 +STAGE2_RELOC= 0x00af0000 +# Base of the heap (ethernet buffers will be allocated below it) +HEAP_START= 0x00c00000 diff --git a/sys/arch/mvme88k/stand/bootsd/version.c b/sys/arch/mvme88k/stand/bootsd/version.c index 0fc14743d10..95206d2b981 100644 --- a/sys/arch/mvme88k/stand/bootsd/version.c +++ b/sys/arch/mvme88k/stand/bootsd/version.c @@ -1,8 +1,9 @@ -/* $OpenBSD: version.c,v 1.5 2008/04/02 21:53:17 miod Exp $ */ +/* $OpenBSD: version.c,v 1.6 2009/01/18 21:49:11 miod Exp $ */ /* + * 1.6 allocation area changed to fix netboot buffers overwriting stack * 1.5 rewritten crt code, self-relocatable * 1.4 kernel loaded with loadfile, a.out and ELF formats * 1.3 rewritten startup code and general cleanup */ -char *version = "1.5"; +char *version = "1.6"; diff --git a/sys/arch/mvme88k/stand/bootst/version.c b/sys/arch/mvme88k/stand/bootst/version.c index 6d117df67e7..fc036572aa5 100644 --- a/sys/arch/mvme88k/stand/bootst/version.c +++ b/sys/arch/mvme88k/stand/bootst/version.c @@ -1,8 +1,9 @@ -/* $OpenBSD: version.c,v 1.5 2008/04/02 21:53:17 miod Exp $ */ +/* $OpenBSD: version.c,v 1.6 2009/01/18 21:49:11 miod Exp $ */ /* + * 1.6 allocation area changed to fix netboot buffers overwriting stack * 1.5 rewritten crt code * 1.4 kernel loaded with loadfile, a.out and ELF formats * 1.3 rewritten startup code and general cleanup */ -char *version = "1.5"; +char *version = "1.6"; diff --git a/sys/arch/mvme88k/stand/netboot/if_ie.c b/sys/arch/mvme88k/stand/netboot/if_ie.c index cfcc47dea5f..5c2c89fa2a2 100644 --- a/sys/arch/mvme88k/stand/netboot/if_ie.c +++ b/sys/arch/mvme88k/stand/netboot/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.8 2006/05/16 22:52:09 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.9 2009/01/18 21:49:11 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -297,7 +297,6 @@ ie_poll(desc, pkt, len) int length = 0; u_short status; - asm(".word 0xf518\n"); status = iem->im_rfd[slot].ie_fd_status; if (status & IE_FD_BUSY) return (0); @@ -439,7 +438,8 @@ ie_init(desc, machdep_hint) bzero(&ie_softc, sizeof(ie_softc)); ie_softc.sc_reg = (struct iereg *) ie_config[desc->io_netif->nif_unit].phys_addr; - ie_softc.sc_mem = (struct iemem *) 0xae0000; + /* use 64KB below HEAP as buffers */ + ie_softc.sc_mem = (struct iemem *)(HEAP_START - 0x10000); ie_reset(desc->io_netif, desc->myea); printf("device: %s%d attached to %s\n", nif->nif_driver->netif_bname, nif->nif_unit, ether_sprintf(desc->myea)); diff --git a/sys/arch/mvme88k/stand/netboot/if_le.c b/sys/arch/mvme88k/stand/netboot/if_le.c index 2b0353f01d1..c607c3bd53e 100644 --- a/sys/arch/mvme88k/stand/netboot/if_le.c +++ b/sys/arch/mvme88k/stand/netboot/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.6 2006/05/16 22:52:26 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.7 2009/01/18 21:49:11 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -423,7 +423,6 @@ le_init(desc, machdep_hint) struct iodesc *desc; void *machdep_hint; { - u_long eram = 4*1024*1024; struct netif *nif = desc->io_netif; if (le_debug) @@ -432,7 +431,7 @@ le_init(desc, machdep_hint) bzero(&le_softc, sizeof(le_softc)); le_softc.sc_r1 = (struct lereg1 *) le_config[desc->io_netif->nif_unit].phys_addr; - le_softc.sc_r2 = (struct lereg2 *) (eram - (1024 * 1024)); + le_softc.sc_r2 = (struct lereg2 *)(HEAP_START - LEMEMSIZE); le_reset(desc->io_netif, desc->myea); printf("device: %s%d attached to %s\n", nif->nif_driver->netif_bname, nif->nif_unit, ether_sprintf(desc->myea)); diff --git a/sys/arch/mvme88k/stand/netboot/if_lereg.h b/sys/arch/mvme88k/stand/netboot/if_lereg.h index c5ef3a72781..a44f313d49e 100644 --- a/sys/arch/mvme88k/stand/netboot/if_lereg.h +++ b/sys/arch/mvme88k/stand/netboot/if_lereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lereg.h,v 1.4 2003/06/02 23:27:52 millert Exp $ */ +/* $OpenBSD: if_lereg.h,v 1.5 2009/01/18 21:49:11 miod Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -40,6 +40,8 @@ #define LETBUFLOG2 0 #define LE_TLEN (LETBUFLOG2 << 13) +#define LEMEMSIZE 16384 /* memory needed to fulfill above settings */ + /* Local Area Network Controller for Ethernet (LANCE) registers */ struct lereg1 { volatile u_short ler1_rdp; /* register data port */ diff --git a/sys/arch/mvme88k/stand/netboot/version.c b/sys/arch/mvme88k/stand/netboot/version.c index a6063045052..dcb0ec1241a 100644 --- a/sys/arch/mvme88k/stand/netboot/version.c +++ b/sys/arch/mvme88k/stand/netboot/version.c @@ -1,9 +1,10 @@ -/* $OpenBSD: version.c,v 1.6 2008/09/19 20:18:03 miod Exp $ */ +/* $OpenBSD: version.c,v 1.7 2009/01/18 21:49:11 miod Exp $ */ /* + * 1.7 allocation area changed to fix netboot buffers overwriting stack * 1.6 perform MVME197 busswitch initialization * 1.5 rewritten crt code, self-relocatable * 1.4 kernel loaded with loadfile, a.out and ELF formats * 1.3 rewritten startup code and general cleanup */ -char *version = "1.6"; +char *version = "1.7"; diff --git a/sys/arch/mvme88k/stand/tftpboot/version.c b/sys/arch/mvme88k/stand/tftpboot/version.c index 719513615c6..27c1364858c 100644 --- a/sys/arch/mvme88k/stand/tftpboot/version.c +++ b/sys/arch/mvme88k/stand/tftpboot/version.c @@ -1,10 +1,11 @@ -/* $OpenBSD: version.c,v 1.5 2008/09/19 20:18:03 miod Exp $ */ +/* $OpenBSD: version.c,v 1.6 2009/01/18 21:49:11 miod Exp $ */ /* + * 1.6 allocation area changed to fix netboot buffers overwriting stack * 1.5 perform MVME197 busswitch initialization * 1.4 rewritten crt code, self-relocatable * 1.3 kernel loaded with loadfile, a.out and ELF formats * 1.2 rewritten startup code and general cleanup * 1.1 initial revision */ -char *version = "1.5"; +char *version = "1.6"; |