diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-10-18 16:54:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-10-18 16:54:36 +0000 |
commit | c1dd31b51b7988f5e44c1a7ca0d9b12071b079a4 (patch) | |
tree | 1eb575da0c498c0271d449a2e940d43c354d8742 /sys/arch/sgi | |
parent | 2a3459992748c304fff0e64a062c25797482fec5 (diff) |
Put back the kl_n_shift variable, removed by mistake in 1.18, causing the
boot blocks to fail on IP27 and IP35 (IP26, IP30 and 32-bit ARCBios systems
unaffected).
While there, provide a simpler ARC_Call() macro for 32-bit boot blocks, and
put a few more variables and statements within explicit __LP64__ guards.
Crank boot blocks version as well.
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r-- | sys/arch/sgi/stand/boot/arcbios.c | 50 | ||||
-rw-r--r-- | sys/arch/sgi/stand/boot/version | 7 |
2 files changed, 40 insertions, 17 deletions
diff --git a/sys/arch/sgi/stand/boot/arcbios.c b/sys/arch/sgi/stand/boot/arcbios.c index 7afb71ed194..c254be76f62 100644 --- a/sys/arch/sgi/stand/boot/arcbios.c +++ b/sys/arch/sgi/stand/boot/arcbios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.c,v 1.18 2012/09/29 21:40:48 miod Exp $ */ +/* $OpenBSD: arcbios.c,v 1.19 2012/10/18 16:54:35 miod Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * Copyright (c) 1996-2004 Opsycon AB. All rights reserved. @@ -36,8 +36,13 @@ #include <stand.h> -int bios_is_32bit; +#ifdef __LP64__ +int bios_is_32bit; +#endif void *bios_base; +#ifdef __LP64__ +u_int kl_n_shift = 32; +#endif int arcbios_init(void); const char *boot_get_path_component(const char *, char *, int *); @@ -60,6 +65,7 @@ static const struct systypes { /* * ARCBios trampoline code. */ +#ifdef __LP64__ #define ARC_Call(Name,Offset) \ __asm__("\n" \ " .text\n" \ @@ -71,17 +77,33 @@ __asm__("\n" \ " lw $3, bios_is_32bit\n"\ " ld $2, bios_base\n"\ " beqz $3, 1f\n" \ -" nop\n" \ +" nop\n" \ " lw $3, 0x20($2)\n" \ -" lw $2," #Offset "($3)\n"\ +" lw $2," #Offset "($3)\n"\ " jr $2\n" \ -" nop\n" \ +" nop\n" \ "1:\n" \ " ld $3, 2*0x20($2)\n"\ " ld $2, 2*" #Offset "($3)\n"\ " jr $2\n" \ -" nop\n" \ +" nop\n" \ " .end " #Name "\n" ); +#else +#define ARC_Call(Name,Offset) \ +__asm__("\n" \ +" .text\n" \ +" .ent " #Name "\n" \ +" .align 3\n" \ +" .set noreorder\n" \ +" .globl " #Name "\n" \ +#Name":\n" \ +" lw $2, bios_base\n"\ +" lw $3, 0x20($2)\n" \ +" lw $2," #Offset "($3)\n"\ +" jr $2\n" \ +" nop\n" \ +" .end " #Name "\n" ); +#endif #if 0 ARC_Call(Bios_Load, 0x00); @@ -210,6 +232,7 @@ arcbios_init() * Figure out if this is an ARCBios machine and if it is, see if we're * dealing with a 32 or 64 bit version. */ +#ifdef __LP64__ if ((ArcBiosBase32->magic == ARC_PARAM_BLK_MAGIC) || (ArcBiosBase32->magic == ARC_PARAM_BLK_MAGIC_BUG)) { bios_is_32bit = 1; @@ -217,6 +240,7 @@ arcbios_init() (ArcBiosBase64->magic == ARC_PARAM_BLK_MAGIC_BUG)) { bios_is_32bit = 0; } +#endif /* * Minimal system identification. @@ -224,22 +248,18 @@ arcbios_init() sid = (arc_sid_t *)Bios_GetSystemId(); cf = (arc_config_t *)Bios_GetChild(NULL); if (cf != NULL) { +#ifdef __LP64__ if (bios_is_32bit) { sysid = (char *)(long)cf->id; sysid_len = cf->id_len; } else { -#ifndef __LP64__ - /* - * Hopeless pointer truncation relying upon sign - * extension; we expect 64-bit ARCS to fail to - * load 32-bit boot code anyway. - */ - sysid = (char *)(int32_t)((arc_config64_t *)cf)->id; -#else sysid = (char *)((arc_config64_t *)cf)->id; -#endif sysid_len = ((arc_config64_t *)cf)->id_len; } +#else + sysid = (char *)(long)cf->id; + sysid_len = cf->id_len; +#endif if (sysid_len > 0 && sysid != NULL) { sysid_len--; diff --git a/sys/arch/sgi/stand/boot/version b/sys/arch/sgi/stand/boot/version index deaebe73282..9380cbcdfbc 100644 --- a/sys/arch/sgi/stand/boot/version +++ b/sys/arch/sgi/stand/boot/version @@ -1,4 +1,4 @@ -/* $OpenBSD: version,v 1.3 2012/09/29 21:40:48 miod Exp $ */ +/* $OpenBSD: version,v 1.4 2012/10/18 16:54:35 miod Exp $ */ /* Public domain. Come on, it can hardly be considered as code. */ #if 0 @@ -22,6 +22,9 @@ No version strings up to 2012 1.3 IP26 support, for real. +1.4 + Unbreak IP27 support, broken by accident in 1.3 + #endif -static const char version[] = "1.3"; +static const char version[] = "1.4"; |