2002-10-24 21:07:56 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-24 22:05:47 +00:00
|
|
|
// $Id$
|
2002-10-24 21:07:56 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2021-01-02 20:49:39 +00:00
|
|
|
// Copyright (C) 2002-2021 The Bochs Project
|
2017-01-13 18:09:51 +00:00
|
|
|
//
|
2002-10-24 21:07:56 +00:00
|
|
|
// extplugin.h
|
|
|
|
//
|
|
|
|
// This header file defines the types necessary to make a Bochs plugin,
|
2017-01-13 18:09:51 +00:00
|
|
|
// but without mentioning all the details of Bochs internals (bochs.h).
|
|
|
|
// It is included by the configuration interfaces and possibly other
|
2002-10-24 21:07:56 +00:00
|
|
|
// things which are intentionally isolated from other parts of the program.
|
|
|
|
//
|
2017-01-13 18:09:51 +00:00
|
|
|
// The original plugin_t struct comes from the plugin.h file from plex86.
|
2002-10-24 21:07:56 +00:00
|
|
|
// Plex86 is Copyright (C) 1999-2000 The plex86 developers team
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __EXTPLUGIN_H
|
|
|
|
#define __EXTPLUGIN_H
|
|
|
|
|
2013-12-29 20:04:16 +00:00
|
|
|
#if BX_PLUGINS && !defined(WIN32)
|
2011-01-23 20:21:21 +00:00
|
|
|
#if BX_HAVE_LTDL
|
|
|
|
#include <ltdl.h>
|
2013-11-07 19:38:23 +00:00
|
|
|
#else
|
2013-12-17 19:57:40 +00:00
|
|
|
#include "ltdl-bochs.h"
|
2002-12-12 15:29:45 +00:00
|
|
|
#endif
|
2011-01-23 20:21:21 +00:00
|
|
|
#endif
|
2002-10-24 21:07:56 +00:00
|
|
|
|
2021-02-26 20:37:49 +00:00
|
|
|
#define PLUGTYPE_NULL 0x00
|
|
|
|
#define PLUGTYPE_CORE 0x01
|
|
|
|
#define PLUGTYPE_STANDARD 0x02
|
|
|
|
#define PLUGTYPE_OPTIONAL 0x04
|
|
|
|
#define PLUGTYPE_VGA 0x08
|
2021-03-27 17:23:31 +00:00
|
|
|
#define PLUGTYPE_USB 0x40
|
|
|
|
#define PLUGTYPE_CI 0x80
|
2021-02-26 20:37:49 +00:00
|
|
|
#define PLUGTYPE_GUI 0x100
|
|
|
|
#define PLUGTYPE_IMG 0x200
|
|
|
|
#define PLUGTYPE_NET 0x400
|
|
|
|
#define PLUGTYPE_SND 0x800
|
|
|
|
|
|
|
|
#define PLUGFLAG_PCI 0x01
|
2002-10-24 21:07:56 +00:00
|
|
|
|
2021-02-07 16:16:06 +00:00
|
|
|
#define PLUGIN_FINI 0
|
|
|
|
#define PLUGIN_INIT 1
|
|
|
|
#define PLUGIN_PROBE 2
|
2021-02-26 20:37:49 +00:00
|
|
|
#define PLUGIN_FLAGS 3
|
2021-02-07 16:16:06 +00:00
|
|
|
|
2021-02-26 20:37:49 +00:00
|
|
|
typedef int (CDECL *plugin_entry_t)(struct _plugin_t *plugin, Bit16u type, Bit8u mode);
|
2011-12-22 10:35:49 +00:00
|
|
|
|
2002-10-24 21:07:56 +00:00
|
|
|
typedef struct _plugin_t
|
|
|
|
{
|
2002-12-12 15:29:45 +00:00
|
|
|
#if BX_PLUGINS
|
2021-01-21 18:10:40 +00:00
|
|
|
char *name;
|
2013-12-29 20:04:16 +00:00
|
|
|
#if defined(WIN32)
|
2011-06-15 17:24:32 +00:00
|
|
|
HINSTANCE handle;
|
|
|
|
#else
|
2002-10-24 21:07:56 +00:00
|
|
|
lt_dlhandle handle;
|
2011-06-15 17:24:32 +00:00
|
|
|
#endif
|
2021-01-21 18:10:40 +00:00
|
|
|
#else
|
|
|
|
const char *name;
|
2002-12-12 15:29:45 +00:00
|
|
|
#endif
|
2021-02-26 20:37:49 +00:00
|
|
|
Bit16u type;
|
|
|
|
Bit8u flags;
|
2021-01-23 12:06:11 +00:00
|
|
|
plugin_entry_t plugin_entry;
|
2021-01-21 18:10:40 +00:00
|
|
|
bool initialized;
|
2021-02-26 20:37:49 +00:00
|
|
|
Bit16u loadtype;
|
2002-10-24 21:07:56 +00:00
|
|
|
|
2021-02-26 20:37:49 +00:00
|
|
|
#if BX_PLUGINS
|
2002-10-24 21:07:56 +00:00
|
|
|
struct _plugin_t *next;
|
2021-01-21 18:10:40 +00:00
|
|
|
#endif
|
2002-10-24 21:07:56 +00:00
|
|
|
} plugin_t;
|
|
|
|
|
|
|
|
#endif /* __EXTPLUGIN_H */
|