mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 12:55:32 -07:00
Merge remote-tracking branch 'upstream/master' into feature/ich2
This commit is contained in:
@@ -107,7 +107,7 @@ extern int vid_cga_contrast, /* (C) video */
|
||||
video_filter_method, /* (C) video */
|
||||
video_vsync, /* (C) video */
|
||||
video_framerate, /* (C) video */
|
||||
gfxcard; /* (C) graphics/video card */
|
||||
gfxcard[2]; /* (C) graphics/video card */
|
||||
extern char video_shader[512]; /* (C) video */
|
||||
extern int bugger_enabled, /* (C) enable ISAbugger */
|
||||
postcard_enabled, /* (C) enable POST card */
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
#define ACPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <atomic>
|
||||
using atomic_int = std::atomic_int;
|
||||
extern "C" {
|
||||
#else
|
||||
#include <stdatomic.h>
|
||||
#endif
|
||||
|
||||
#include <86box/tco.h>
|
||||
@@ -94,7 +98,7 @@ typedef struct
|
||||
slot, irq_mode,
|
||||
irq_pin, irq_line,
|
||||
mirq_is_level;
|
||||
pc_timer_t timer, resume_timer;
|
||||
pc_timer_t timer, resume_timer, pwrbtn_timer;
|
||||
nvr_t *nvr;
|
||||
apm_t *apm;
|
||||
tco_t *tco;
|
||||
@@ -103,7 +107,9 @@ typedef struct
|
||||
} acpi_t;
|
||||
|
||||
/* Global variables. */
|
||||
extern int acpi_rtc_status;
|
||||
extern int acpi_rtc_status;
|
||||
extern atomic_int acpi_pwrbut_pressed;
|
||||
extern int acpi_enabled;
|
||||
|
||||
extern const device_t acpi_ali_device;
|
||||
extern const device_t acpi_intel_device;
|
||||
|
||||
@@ -614,6 +614,7 @@ extern int machine_at_presario4500_init(const machine_t *);
|
||||
extern int machine_at_p55va_init(const machine_t *);
|
||||
extern int machine_at_brio80xx_init(const machine_t *);
|
||||
extern int machine_at_pb680_init(const machine_t *);
|
||||
extern int machine_at_pb810_init(const machine_t *);
|
||||
extern int machine_at_mb520n_init(const machine_t *);
|
||||
extern int machine_at_i430vx_init(const machine_t *);
|
||||
|
||||
@@ -712,6 +713,7 @@ extern int machine_at_cuv4xls_init(const machine_t *);
|
||||
extern int machine_at_6via90ap_init(const machine_t *);
|
||||
extern int machine_at_s1857_init(const machine_t *);
|
||||
extern int machine_at_p6bap_init(const machine_t *);
|
||||
extern int machine_at_p6bat_init(const machine_t *);
|
||||
extern int machine_at_cusl2c_init(const machine_t *);
|
||||
extern int machine_at_j815epda_init(const machine_t *);
|
||||
extern int machine_at_m6tsl_init(const machine_t *);
|
||||
|
||||
@@ -412,20 +412,27 @@
|
||||
#define IDM_VID_SCALE_2X 40056
|
||||
#define IDM_VID_SCALE_3X 40057
|
||||
#define IDM_VID_SCALE_4X 40058
|
||||
#define IDM_VID_HIDPI 40059
|
||||
#define IDM_VID_FULLSCREEN 40060
|
||||
#define IDM_VID_FS_FULL 40061
|
||||
#define IDM_VID_FS_43 40062
|
||||
#define IDM_VID_FS_KEEPRATIO 40063
|
||||
#define IDM_VID_FS_INT 40064
|
||||
#define IDM_VID_SPECIFY_DIM 40065
|
||||
#define IDM_VID_FORCE43 40066
|
||||
#define IDM_VID_OVERSCAN 40067
|
||||
#define IDM_VID_INVERT 40069
|
||||
#define IDM_VID_CGACON 40070
|
||||
#define IDM_VID_GRAYCT_601 40075
|
||||
#define IDM_VID_GRAYCT_709 40076
|
||||
#define IDM_VID_GRAYCT_AVE 40077
|
||||
#define IDM_VID_SCALE_5X 40059
|
||||
#define IDM_VID_SCALE_6X 40060
|
||||
#define IDM_VID_SCALE_7X 40061
|
||||
#define IDM_VID_SCALE_8X 40062
|
||||
#define IDM_VID_SCALE_9X 40063
|
||||
#define IDM_VID_SCALE_10X 40064
|
||||
|
||||
#define IDM_VID_HIDPI 40065
|
||||
#define IDM_VID_FULLSCREEN 40066
|
||||
#define IDM_VID_FS_FULL 40067
|
||||
#define IDM_VID_FS_43 40068
|
||||
#define IDM_VID_FS_KEEPRATIO 40069
|
||||
#define IDM_VID_FS_INT 40070
|
||||
#define IDM_VID_SPECIFY_DIM 40071
|
||||
#define IDM_VID_FORCE43 40072
|
||||
#define IDM_VID_OVERSCAN 40073
|
||||
#define IDM_VID_INVERT 40074
|
||||
#define IDM_VID_CGACON 40075
|
||||
#define IDM_VID_GRAYCT_601 40076
|
||||
#define IDM_VID_GRAYCT_709 40077
|
||||
#define IDM_VID_GRAYCT_AVE 40078
|
||||
#define IDM_VID_GRAY_RGB 40080
|
||||
#define IDM_VID_GRAY_MONO 40081
|
||||
#define IDM_VID_GRAY_AMBER 40082
|
||||
|
||||
@@ -132,7 +132,6 @@ extern monitor_t monitors[MONITORS_NUM];
|
||||
extern monitor_settings_t monitor_settings[MONITORS_NUM];
|
||||
extern atomic_bool doresize_monitors[MONITORS_NUM];
|
||||
extern int monitor_index_global;
|
||||
extern int gfxcard_2;
|
||||
extern int show_second_monitors;
|
||||
extern int video_fullscreen_scale_maximized;
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#define SLIRP_MAJOR_VERSION 4
|
||||
#define SLIRP_MINOR_VERSION 3
|
||||
#define SLIRP_MICRO_VERSION 1
|
||||
#define SLIRP_VERSION_STRING "4.3.1-git-86Box"
|
||||
#define SLIRP_MINOR_VERSION 7
|
||||
#define SLIRP_MICRO_VERSION 0
|
||||
#define SLIRP_VERSION_STRING "4.7.0-86Box"
|
||||
|
||||
#define SLIRP_CHECK_VERSION(major,minor,micro) \
|
||||
(SLIRP_MAJOR_VERSION > (major) || \
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <in6addr.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
@@ -31,8 +32,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Opaque structure containing the slirp state */
|
||||
typedef struct Slirp Slirp;
|
||||
|
||||
/* Flags passed to SlirpAddPollCb and to be returned by SlirpGetREventsCb. */
|
||||
enum {
|
||||
SLIRP_POLL_IN = 1 << 0,
|
||||
SLIRP_POLL_OUT = 1 << 1,
|
||||
@@ -47,38 +50,58 @@ typedef void (*SlirpTimerCb)(void *opaque);
|
||||
typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque);
|
||||
typedef int (*SlirpGetREventsCb)(int idx, void *opaque);
|
||||
|
||||
typedef enum SlirpTimerId {
|
||||
SLIRP_TIMER_RA,
|
||||
SLIRP_TIMER_NUM,
|
||||
} SlirpTimerId;
|
||||
|
||||
/*
|
||||
* Callbacks from slirp
|
||||
* Callbacks from slirp, to be set by the application.
|
||||
*
|
||||
* The opaque parameter is set to the opaque pointer given in the slirp_new /
|
||||
* slirp_init call.
|
||||
*/
|
||||
typedef struct SlirpCb {
|
||||
/*
|
||||
* Send an ethernet frame to the guest network. The opaque
|
||||
* parameter is the one given to slirp_init(). The function
|
||||
* doesn't need to send all the data and may return <len (no
|
||||
* buffering is done on libslirp side, so the data will be dropped
|
||||
* in this case). <0 reports an IO error.
|
||||
* Send an ethernet frame to the guest network. The opaque parameter is the
|
||||
* one given to slirp_init(). If the guest is not ready to receive a frame,
|
||||
* the function can just drop the data. TCP will then handle retransmissions
|
||||
* at a lower pace.
|
||||
* <0 reports an IO error.
|
||||
*/
|
||||
SlirpWriteCb send_packet;
|
||||
/* Print a message for an error due to guest misbehavior. */
|
||||
void (*guest_error)(const char *msg, void *opaque);
|
||||
/* Return the virtual clock value in nanoseconds */
|
||||
int64_t (*clock_get_ns)(void *opaque);
|
||||
/* Create a new timer with the given callback and opaque data */
|
||||
/* Create a new timer with the given callback and opaque data. Not
|
||||
* needed if timer_new_opaque is provided. */
|
||||
void *(*timer_new)(SlirpTimerCb cb, void *cb_opaque, void *opaque);
|
||||
/* Remove and free a timer */
|
||||
void (*timer_free)(void *timer, void *opaque);
|
||||
/* Modify a timer to expire at @expire_time */
|
||||
/* Modify a timer to expire at @expire_time (ms) */
|
||||
void (*timer_mod)(void *timer, int64_t expire_time, void *opaque);
|
||||
/* Register a fd for future polling */
|
||||
void (*register_poll_fd)(int fd, void *opaque);
|
||||
/* Unregister a fd */
|
||||
void (*unregister_poll_fd)(int fd, void *opaque);
|
||||
/* Kick the io-thread, to signal that new events may be processed */
|
||||
/* Kick the io-thread, to signal that new events may be processed because some TCP buffer
|
||||
* can now receive more data, i.e. slirp_socket_can_recv will return 1. */
|
||||
void (*notify)(void *opaque);
|
||||
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 4 begin
|
||||
*/
|
||||
|
||||
/* Initialization has completed and a Slirp* has been created. */
|
||||
void (*init_completed)(Slirp *slirp, void *opaque);
|
||||
/* Create a new timer. When the timer fires, the application passes
|
||||
* the SlirpTimerId and cb_opaque to slirp_handle_timer. */
|
||||
void *(*timer_new_opaque)(SlirpTimerId id, void *cb_opaque, void *opaque);
|
||||
} SlirpCb;
|
||||
|
||||
#define SLIRP_CONFIG_VERSION_MIN 1
|
||||
#define SLIRP_CONFIG_VERSION_MAX 3
|
||||
#define SLIRP_CONFIG_VERSION_MAX 4
|
||||
|
||||
typedef struct SlirpConfig {
|
||||
/* Version must be provided */
|
||||
@@ -124,8 +147,13 @@ typedef struct SlirpConfig {
|
||||
* Fields introduced in SlirpConfig version 3 begin
|
||||
*/
|
||||
bool disable_dns; /* slirp will not redirect/serve any DNS packet */
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 4 begin
|
||||
*/
|
||||
bool disable_dhcp; /* slirp will not reply to any DHCP requests */
|
||||
} SlirpConfig;
|
||||
|
||||
/* Create a new instance of a slirp stack */
|
||||
Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks,
|
||||
void *opaque);
|
||||
/* slirp_init is deprecated in favor of slirp_new */
|
||||
@@ -139,44 +167,103 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
|
||||
struct in6_addr vnameserver6, const char **vdnssearch,
|
||||
const char *vdomainname, const SlirpCb *callbacks,
|
||||
void *opaque);
|
||||
/* Shut down an instance of a slirp stack */
|
||||
void slirp_cleanup(Slirp *slirp);
|
||||
|
||||
/* This is called by the application when it is about to sleep through poll().
|
||||
* *timeout is set to the amount of virtual time (in ms) that the application intends to
|
||||
* wait (UINT32_MAX if infinite). slirp_pollfds_fill updates it according to
|
||||
* e.g. TCP timers, so the application knows it should sleep a smaller amount of
|
||||
* time. slirp_pollfds_fill calls add_poll for each file descriptor
|
||||
* that should be monitored along the sleep. The opaque pointer is passed as
|
||||
* such to add_poll, and add_poll returns an index. */
|
||||
void slirp_pollfds_fill(Slirp *slirp, uint32_t *timeout,
|
||||
SlirpAddPollCb add_poll, void *opaque);
|
||||
|
||||
/* This is called by the application after sleeping, to report which file
|
||||
* descriptors are available. slirp_pollfds_poll calls get_revents on each file
|
||||
* descriptor, giving it the index that add_poll returned during the
|
||||
* slirp_pollfds_fill call, to know whether the descriptor is available for
|
||||
* read/write/etc. (SLIRP_POLL_*)
|
||||
* select_error should be passed 1 if poll() returned an error. */
|
||||
void slirp_pollfds_poll(Slirp *slirp, int select_error,
|
||||
SlirpGetREventsCb get_revents, void *opaque);
|
||||
|
||||
/* This is called by the application when the guest emits a packet on the
|
||||
* guest network, to be interpreted by slirp. */
|
||||
void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len);
|
||||
|
||||
/* This is called by the application when a timer expires, if it provides
|
||||
* the timer_new_opaque callback. It is not needed if the application only
|
||||
* uses timer_new. */
|
||||
void slirp_handle_timer(Slirp *slirp, SlirpTimerId id, void *cb_opaque);
|
||||
|
||||
/* These set up / remove port forwarding between a host port in the real world
|
||||
* and the guest network. */
|
||||
int slirp_add_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr,
|
||||
int host_port, struct in_addr guest_addr, int guest_port);
|
||||
int slirp_remove_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr,
|
||||
int host_port);
|
||||
|
||||
#define SLIRP_HOSTFWD_UDP 1
|
||||
#define SLIRP_HOSTFWD_V6ONLY 2
|
||||
int slirp_add_hostxfwd(Slirp *slirp,
|
||||
const struct sockaddr *haddr, socklen_t haddrlen,
|
||||
const struct sockaddr *gaddr, socklen_t gaddrlen,
|
||||
int flags);
|
||||
int slirp_remove_hostxfwd(Slirp *slirp,
|
||||
const struct sockaddr *haddr, socklen_t haddrlen,
|
||||
int flags);
|
||||
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* command running on the host */
|
||||
int slirp_add_exec(Slirp *slirp, const char *cmdline,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* Unix port on the host */
|
||||
int slirp_add_unix(Slirp *slirp, const char *unixsock,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* callback that will receive the data coming from the port */
|
||||
int slirp_add_guestfwd(Slirp *slirp, SlirpWriteCb write_cb, void *opaque,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
/* remove entries added by slirp_add_exec, slirp_add_unix or slirp_add_guestfwd */
|
||||
|
||||
/* TODO: rather identify a guestfwd through an opaque pointer instead of through
|
||||
* the guest_addr */
|
||||
|
||||
/* This is called by the application for a guestfwd, to determine how much data
|
||||
* can be received by the forwarded port through a call to slirp_socket_recv. */
|
||||
size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
|
||||
int guest_port);
|
||||
/* This is called by the application for a guestfwd, to provide the data to be
|
||||
* sent on the forwarded port */
|
||||
void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr, int guest_port,
|
||||
const uint8_t *buf, int size);
|
||||
|
||||
/* Remove entries added by slirp_add_exec, slirp_add_unix or slirp_add_guestfwd */
|
||||
int slirp_remove_guestfwd(Slirp *slirp, struct in_addr guest_addr,
|
||||
int guest_port);
|
||||
|
||||
/* Return a human-readable state of the slirp stack */
|
||||
char *slirp_connection_info(Slirp *slirp);
|
||||
|
||||
void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr, int guest_port,
|
||||
const uint8_t *buf, int size);
|
||||
size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
|
||||
int guest_port);
|
||||
/* Return a human-readable state of the NDP/ARP tables */
|
||||
char *slirp_neighbor_info(Slirp *slirp);
|
||||
|
||||
/* Save the slirp state through the write_cb. The opaque pointer is passed as
|
||||
* such to the write_cb. */
|
||||
void slirp_state_save(Slirp *s, SlirpWriteCb write_cb, void *opaque);
|
||||
|
||||
/* Returns the version of the slirp state, to be saved along the state */
|
||||
int slirp_state_version(void);
|
||||
|
||||
/* Load the slirp state through the read_cb. The opaque pointer is passed as
|
||||
* such to the read_cb. The version should be given as it was obtained from
|
||||
* slirp_state_version when slirp_state_save was called. */
|
||||
int slirp_state_load(Slirp *s, int version_id, SlirpReadCb read_cb,
|
||||
void *opaque);
|
||||
|
||||
int slirp_state_version(void);
|
||||
|
||||
/* Return the version of the slirp implementation */
|
||||
const char *slirp_version_string(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -124,6 +124,8 @@ extern gboolean g_spawn_async_with_fds(const gchar *working_directory, gchar **a
|
||||
GSpawnChildSetupFunc child_setup,
|
||||
gpointer user_data, GPid *child_pid, gint stdin_fd,
|
||||
gint stdout_fd, gint stderr_fd, GError **error);
|
||||
extern gboolean g_str_has_prefix (const gchar *str,
|
||||
const gchar *prefix);
|
||||
extern GString *g_string_new(gchar *base);
|
||||
extern gchar *g_string_free(GString *string, gboolean free_segment);
|
||||
extern gchar *g_strstr_len(const gchar *haystack, gssize haystack_len, const gchar *needle);
|
||||
|
||||
Reference in New Issue
Block a user