Don't maintain an unimplemented vector for each arcbios vector.

Rather, cast our single vector. We weren't reporting which vector
when panicking, and if somebody uses a vector that isn't
implemented it should be easy enough to trap down anyways.
This commit is contained in:
rumble 2005-04-07 23:36:48 +00:00
parent 0f32e1f4a6
commit 9f17d61687
2 changed files with 41 additions and 260 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcemu.c,v 1.8 2004/11/12 23:28:05 sekiya Exp $ */
/* $NetBSD: arcemu.c,v 1.9 2005/04/07 23:36:48 rumble Exp $ */
/*
* Copyright (c) 2004 Steve Rumble
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arcemu.c,v 1.8 2004/11/12 23:28:05 sekiya Exp $");
__KERNEL_RCSID(0, "$NetBSD: arcemu.c,v 1.9 2005/04/07 23:36:48 rumble Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -67,41 +67,41 @@ static struct consdev arcemu_ip12_cn = {
*/
static struct arcbios_fv arcemu_v = {
.Load = arcemu_unimpl_Load,
.Invoke = arcemu_unimpl_Invoke,
.Execute = arcemu_unimpl_Execute,
.Halt = arcemu_unimpl_void_void_noret,
.PowerDown = arcemu_unimpl_void_void_noret,
.Restart = arcemu_unimpl_void_void_noret,
.Reboot = arcemu_unimpl_void_void_noret,
.EnterInteractiveMode = arcemu_unimpl_void_void_noret,
.Load = ARCEMU_UNIMPL,
.Invoke = ARCEMU_UNIMPL,
.Execute = ARCEMU_UNIMPL,
.Halt = ARCEMU_UNIMPL,
.PowerDown = ARCEMU_UNIMPL,
.Restart = ARCEMU_UNIMPL,
.Reboot = ARCEMU_UNIMPL,
.EnterInteractiveMode = ARCEMU_UNIMPL,
.reserved0 = NULL,
.GetPeer = arcemu_unimpl_voidptr_voidptr,
.GetChild = arcemu_unimpl_voidptr_voidptr,
.GetParent = arcemu_unimpl_voidptr_voidptr,
.GetConfigurationData = arcemu_unimpl_GetConfigurationData,
.AddChild = arcemu_unimpl_AddChild,
.DeleteComponent = arcemu_unimpl_DeleteComponent,
.GetComponent = arcemu_unimpl_GetComponent,
.SaveConfiguration = arcemu_unimpl_SaveConfiguration,
.GetSystemId = arcemu_unimpl_voidptr_void,
.GetMemoryDescriptor = arcemu_unimpl_GetMemoryDescriptor,
.GetPeer = ARCEMU_UNIMPL,
.GetChild = ARCEMU_UNIMPL,
.GetParent = ARCEMU_UNIMPL,
.GetConfigurationData = ARCEMU_UNIMPL,
.AddChild = ARCEMU_UNIMPL,
.DeleteComponent = ARCEMU_UNIMPL,
.GetComponent = ARCEMU_UNIMPL,
.SaveConfiguration = ARCEMU_UNIMPL,
.GetSystemId = ARCEMU_UNIMPL,
.GetMemoryDescriptor = ARCEMU_UNIMPL,
.reserved1 = NULL,
.GetTime = arcemu_unimpl_voidptr_void,
.GetRelativeTime = arcemu_unimpl_GetRelativeTime,
.GetDirectoryEntry = arcemu_unimpl_GetDirectoryEntry,
.Open = arcemu_unimpl_Open,
.Close = arcemu_unimpl_Close,
.Read = arcemu_unimpl_GetDirectoryEntry,
.GetReadStatus = arcemu_unimpl_GetReadStatus,
.Write = arcemu_unimpl_GetDirectoryEntry,
.Seek = arcemu_unimpl_Seek,
.Mount = arcemu_unimpl_Mount,
.GetEnvironmentVariable = arcemu_unimpl_GetEnvironmentVariable,
.SetEnvironmentVariable = arcemu_unimpl_SetEnvironmentVariable,
.GetFileInformation = arcemu_unimpl_GetFileInformation,
.SetFileInformation = arcemu_unimpl_SetFileInformation,
.FlushAllCaches = arcemu_unimpl_void_void
.GetTime = ARCEMU_UNIMPL,
.GetRelativeTime = ARCEMU_UNIMPL,
.GetDirectoryEntry = ARCEMU_UNIMPL,
.Open = ARCEMU_UNIMPL,
.Close = ARCEMU_UNIMPL,
.Read = ARCEMU_UNIMPL,
.GetReadStatus = ARCEMU_UNIMPL,
.Write = ARCEMU_UNIMPL,
.Seek = ARCEMU_UNIMPL,
.Mount = ARCEMU_UNIMPL,
.GetEnvironmentVariable = ARCEMU_UNIMPL,
.SetEnvironmentVariable = ARCEMU_UNIMPL,
.GetFileInformation = ARCEMU_UNIMPL,
.SetFileInformation = ARCEMU_UNIMPL,
.FlushAllCaches = ARCEMU_UNIMPL
};
/*
@ -409,200 +409,10 @@ arcemu_ip12_putc(dev_t dummy, int c)
ip12_prom_printf("%c", c);
}
/*
* Unimplemented Vectors
*/
/* Unimplemented Vector */
static void
arcemu_unimpl()
{
panic("arcemu vector not established on IP%d.\n", mach_type);
}
static void
arcemu_unimpl_void_void_noret()
{
panic("arcemu vector not established on IP%d.\n", mach_type);
}
static void
arcemu_unimpl_void_void()
{
arcemu_unimpl();
}
static void *
arcemu_unimpl_voidptr_void()
{
arcemu_unimpl();
return (NULL);
}
static void *
arcemu_unimpl_voidptr_voidptr(void *a)
{
arcemu_unimpl();
return (NULL);
}
static paddr_t
arcemu_unimpl_Load(char *a, paddr_t b, paddr_t c, paddr_t *d)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Invoke(paddr_t a, paddr_t b, paddr_t c, char **d, char **e)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Execute(char *a, paddr_t b, char **c, char **d)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_GetConfigurationData(void *a, void *b)
{
arcemu_unimpl();
return (0);
}
static void *
arcemu_unimpl_AddChild(void *a, void *b)
{
arcemu_unimpl();
return (NULL);
}
static paddr_t
arcemu_unimpl_DeleteComponent(void *a)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_GetComponent(char *a)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_SaveConfiguration()
{
arcemu_unimpl();
return (0);
}
static void *
arcemu_unimpl_GetMemoryDescriptor(void *a)
{
arcemu_unimpl();
return (NULL);
}
static paddr_t
arcemu_unimpl_GetRelativeTime()
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_GetDirectoryEntry(paddr_t a, void *b, paddr_t c, paddr_t *d)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Open(char *a, paddr_t b, paddr_t *c)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Close(paddr_t a)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_GetReadStatus(paddr_t a)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Seek(paddr_t a, int64_t *b, paddr_t c)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_Mount(char *a, paddr_t b)
{
arcemu_unimpl();
return (0);
}
static char *
arcemu_unimpl_GetEnvironmentVariable(char *a)
{
arcemu_unimpl();
return (NULL);
}
static paddr_t
arcemu_unimpl_SetEnvironmentVariable(char *a, char *b)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_GetFileInformation(paddr_t a, void *b)
{
arcemu_unimpl();
return (0);
}
static paddr_t
arcemu_unimpl_SetFileInformation(paddr_t a, paddr_t b, paddr_t c)
{
arcemu_unimpl();
return (0);
panic("arcemu vector not established on IP%d", mach_type);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcemu.h,v 1.3 2004/10/02 08:53:09 sekiya Exp $ */
/* $NetBSD: arcemu.h,v 1.4 2005/04/07 23:36:48 rumble Exp $ */
/*
* Copyright (c) 2004 Steve Rumble
@ -65,38 +65,9 @@ static struct arcbios_component ip12_tree[] = {
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL }
};
/*
* Unimplmented Vectors
*/
/* Unimplmented Vector */
#define ARCEMU_UNIMPL ((void *)arcemu_unimpl)
static void arcemu_unimpl(void);
static void arcemu_unimpl_void_void_noret(void)
__attribute__((__noreturn__));
static void arcemu_unimpl_void_void(void);
static void *arcemu_unimpl_voidptr_void(void);
static void *arcemu_unimpl_voidptr_voidptr(void *);
static paddr_t arcemu_unimpl_Load(char *, paddr_t, paddr_t, paddr_t *);
static paddr_t arcemu_unimpl_Invoke(paddr_t, paddr_t, paddr_t, char **,
char **);
static paddr_t arcemu_unimpl_Execute(char *, paddr_t, char **, char **);
static paddr_t arcemu_unimpl_GetConfigurationData(void *, void *);
static void *arcemu_unimpl_AddChild(void *, void *);
static paddr_t arcemu_unimpl_DeleteComponent(void *);
static paddr_t arcemu_unimpl_GetComponent(char *);
static paddr_t arcemu_unimpl_SaveConfiguration(void);
static void *arcemu_unimpl_GetMemoryDescriptor(void *);
static paddr_t arcemu_unimpl_GetRelativeTime(void);
static paddr_t arcemu_unimpl_GetDirectoryEntry(paddr_t, void *, paddr_t,
paddr_t *);
static paddr_t arcemu_unimpl_Open(char *, paddr_t, paddr_t *);
static paddr_t arcemu_unimpl_Close(paddr_t);
static paddr_t arcemu_unimpl_GetReadStatus(paddr_t);
static paddr_t arcemu_unimpl_Seek(paddr_t, int64_t *, paddr_t);
static paddr_t arcemu_unimpl_Mount(char *, paddr_t);
static char *arcemu_unimpl_GetEnvironmentVariable(char *);
static paddr_t arcemu_unimpl_SetEnvironmentVariable(char *, char *);
static paddr_t arcemu_unimpl_GetFileInformation(paddr_t, void *);
static paddr_t arcemu_unimpl_SetFileInformation(paddr_t, paddr_t, paddr_t);
#endif /* _ARCEMU_PRIVATE */