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