Skip to content

Commit 5be8823

Browse files
authored
Merge pull request 86Box#5288 from Cacodemon345/cpu_timer_separation
Don't include `cpu.h` in `timer.h`
2 parents 78f50c5 + 4090c5a commit 5be8823

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+48
-20
lines changed

src/chipset/ali1531.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <wchar.h>
2323
#define HAVE_STDARG_H
2424
#include <86box/86box.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627

2728
#include <86box/device.h>

src/chipset/ali1541.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <wchar.h>
2323
#define HAVE_STDARG_H
2424
#include <86box/86box.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627

2728
#include <86box/device.h>

src/chipset/ali1543.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <wchar.h>
2323
#define HAVE_STDARG_H
2424
#include <86box/86box.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/device.h>
2728
#include <86box/io.h>

src/chipset/ali6117.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <86box/io.h>
2727
#include <86box/pci.h>
2828
#include <86box/pic.h>
29+
#include "cpu.h"
2930
#include <86box/timer.h>
3031
#include <86box/pit.h>
3132
#include <86box/device.h>

src/chipset/gc100.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define HAVE_STDARG_H
2828
#include <86box/86box.h>
2929
#include <86box/nmi.h>
30+
#include "cpu.h"
3031
#include <86box/timer.h>
3132
#include <86box/pit.h>
3233
#include <86box/mem.h>

src/chipset/sis_5511_h2p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/dma.h>
2728
#include <86box/mem.h>

src/chipset/sis_5513_p2i.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627

2728
#include <86box/dma.h>

src/chipset/sis_5571_h2p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/dma.h>
2728
#include <86box/mem.h>

src/chipset/sis_5581_h2p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/dma.h>
2728
#include <86box/mem.h>

src/chipset/sis_5591_h2p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/dma.h>
2728
#include <86box/mem.h>

src/chipset/sis_5600_h2p.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <86box/86box.h>
2323
#include <86box/device.h>
2424
#include <86box/io.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/dma.h>
2728
#include <86box/mem.h>

src/chipset/sis_85c50x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <86box/86box.h>
2525
#include <86box/device.h>
2626
#include <86box/io.h>
27+
#include "cpu.h"
2728
#include <86box/timer.h>
2829
#include <86box/apm.h>
2930
#include <86box/machine.h>

src/device/cartridge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <wchar.h>
2323
#define HAVE_STDARG_H
2424
#include <86box/86box.h>
25+
#include "cpu.h"
2526
#include <86box/timer.h>
2627
#include <86box/plat.h>
2728
#include <86box/ui.h>

src/device/keyboard_xt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <wchar.h>
3030
#include <86box/86box.h>
3131
#include <86box/device.h>
32+
#include "cpu.h"
3233
#include <86box/timer.h>
3334
#include <86box/fdd.h>
3435
#include <86box/machine.h>

src/device/serial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define HAVE_STDARG_H
2828
#include <86box/86box.h>
2929
#include <86box/device.h>
30+
#include "cpu.h"
3031
#include <86box/timer.h>
3132
#include <86box/machine.h>
3233
#include <86box/io.h>

src/include/86box/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _TIMER_H_
22
#define _TIMER_H_
33

4-
#include "cpu.h"
4+
extern uint64_t tsc;
55

66
/* Maximum period, currently 1 second. */
77
#define MAX_USEC64 1000000ULL

src/include/86box/video.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ enum {
6969
#define VIDEO_FLAG_TYPE_NONE 5
7070
#define VIDEO_FLAG_TYPE_MASK 7
7171

72+
#define VIDEO_FLAG_TYPE_SECONDARY VIDEO_FLAG_TYPE_SPECIAL
73+
7274
typedef struct video_timings_t {
7375
int type;
7476
int write_b;

src/machine/m_at_socket5.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <86box/fdc_ext.h>
3030
#include <86box/hdc.h>
3131
#include <86box/hdc_ide.h>
32+
#include "cpu.h"
3233
#include <86box/timer.h>
3334
#include <86box/fdd.h>
3435
#include <86box/fdc.h>

src/machine/m_xt_olivetti.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <wchar.h>
3131
#define HAVE_STDARG_H
3232
#include <86box/86box.h>
33+
#include "cpu.h"
3334
#include <86box/timer.h>
3435
#include <86box/io.h>
3536
#include <86box/pic.h>

src/machine/m_xt_philips.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define HAVE_STDARG_H
2424
#include <86box/86box.h>
2525
#include <86box/nmi.h>
26+
#include "cpu.h"
2627
#include <86box/timer.h>
2728
#include <86box/pit.h>
2829
#include <86box/mem.h>

src/mem/sst_flash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <86box/device.h>
2626
#include <86box/mem.h>
2727
#include <86box/machine.h>
28+
#include "cpu.h"
2829
#include <86box/timer.h>
2930
#include <86box/nvr.h>
3031
#include <86box/plat.h>

src/qt/qt_machinestatus.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#include "qt_machinestatus.hpp"
2020

2121
extern "C" {
22-
#define EMU_CPU_H // superhack - don't want timer.h to include cpu.h here, and some combo is preventing a compile
23-
extern uint64_t tsc;
24-
2522
#include <86box/hdd.h>
2623
#include <86box/timer.h>
2724
#include <86box/86box.h>

src/qt/qt_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ extern MainWindow *main_window;
8686

8787
extern "C" {
8888
#include <86box/keyboard.h>
89+
#include "cpu.h"
8990
#include <86box/timer.h>
9091
#include <86box/nvr.h>
9192
extern int qt_nvr_save(void);

src/qt/qt_mainwindow.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ extern "C" {
4848
#include <86box/machine.h>
4949
#include <86box/vid_ega.h>
5050
#include <86box/version.h>
51-
#if 0
52-
#include <86box/acpi.h> /* Requires timer.h include, which conflicts with Qt headers */
53-
#endif
54-
extern atomic_int acpi_pwrbut_pressed;
55-
extern int acpi_enabled;
51+
#include <86box/timer.h>
52+
#include <86box/apm.h>
53+
#include <86box/nvr.h>
54+
#include <86box/acpi.h>
5655

5756
#ifdef USE_VNC
5857
# include <86box/vnc.h>

src/qt/qt_settingsdisplay.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
220220
int secondaryFlags = video_card_get_flags(c);
221221
if (video_card_available(c)
222222
&& device_is_valid(video_dev, machineId)
223-
&& !((secondaryFlags == primaryFlags) && (secondaryFlags != VIDEO_FLAG_TYPE_SPECIAL))
224-
&& !(((primaryFlags == VIDEO_FLAG_TYPE_8514) || (primaryFlags == VIDEO_FLAG_TYPE_XGA)) && (secondaryFlags != VIDEO_FLAG_TYPE_MDA) && (secondaryFlags != VIDEO_FLAG_TYPE_SPECIAL))
225-
&& !((primaryFlags != VIDEO_FLAG_TYPE_MDA) && (primaryFlags != VIDEO_FLAG_TYPE_SPECIAL) && ((secondaryFlags == VIDEO_FLAG_TYPE_8514) || (secondaryFlags == VIDEO_FLAG_TYPE_XGA)))) {
223+
&& !((secondaryFlags == primaryFlags) && (secondaryFlags != VIDEO_FLAG_TYPE_SECONDARY))
224+
&& !(((primaryFlags == VIDEO_FLAG_TYPE_8514) || (primaryFlags == VIDEO_FLAG_TYPE_XGA)) && (secondaryFlags != VIDEO_FLAG_TYPE_MDA) && (secondaryFlags != VIDEO_FLAG_TYPE_SECONDARY))
225+
&& !((primaryFlags != VIDEO_FLAG_TYPE_MDA) && (primaryFlags != VIDEO_FLAG_TYPE_SECONDARY) && ((secondaryFlags == VIDEO_FLAG_TYPE_8514) || (secondaryFlags == VIDEO_FLAG_TYPE_XGA)))) {
226226
ui->comboBoxVideoSecondary->addItem(name, c);
227227
if (c == curVideoCard_2)
228228
ui->comboBoxVideoSecondary->setCurrentIndex(ui->comboBoxVideoSecondary->count() - 1);

src/qt/qt_settingsmachine.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ extern "C" {
3232
#include <86box/config.h>
3333
#include <86box/device.h>
3434
#include <86box/machine.h>
35+
#include <86box/nvr.h>
3536
}
3637

37-
// from nvr.h, which we can't import into CPP code
38-
#define TIME_SYNC_DISABLED 0
39-
#define TIME_SYNC_ENABLED 1
40-
#define TIME_SYNC_UTC 2
41-
4238
#include "qt_deviceconfig.hpp"
4339
#include "qt_models_common.hpp"
4440

src/scsi/scsi_t128.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define HAVE_STDARG_H
3030
#include <86box/86box.h>
3131
#include <86box/io.h>
32+
#include "cpu.h"
3233
#include <86box/timer.h>
3334
#include <86box/dma.h>
3435
#include <86box/pic.h>

src/sound/snd_audiopci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <86box/pci.h>
4040
#include <86box/snd_ac97.h>
4141
#include <86box/sound.h>
42+
#include "cpu.h"
4243
#include <86box/timer.h>
4344
#include <86box/plat_unused.h>
4445
#include <86box/snd_akm4531.h>

src/sound/snd_gus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <86box/nmi.h>
1616
#include <86box/pic.h>
1717
#include <86box/sound.h>
18+
#include "cpu.h"
1819
#include <86box/timer.h>
1920
#ifdef USE_GUSMAX
2021
# include <86box/snd_ad1848.h>

src/sound/snd_opl_esfm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <86box/86box.h>
3333
#include <86box/sound.h>
3434
#include <86box/device.h>
35+
#include "cpu.h"
3536
#include <86box/timer.h>
3637
#include <86box/snd_opl.h>
3738
#include <86box/plat_unused.h>

src/sound/snd_opl_nuked.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define HAVE_STDARG_H
4747
#include <86box/86box.h>
4848
#include <86box/sound.h>
49+
#include "cpu.h"
4950
#include <86box/timer.h>
5051
#include <86box/device.h>
5152
#include <86box/snd_opl.h>

src/sound/snd_sb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <86box/pic.h>
4040
#include <86box/rom.h>
4141
#include <86box/sound.h>
42+
#include "cpu.h"
4243
#include <86box/timer.h>
4344
#include <86box/snd_sb.h>
4445
#include <86box/plat_unused.h>

src/timer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string.h>
44
#include <wchar.h>
55
#include <86box/86box.h>
6+
#include "cpu.h"
67
#include <86box/timer.h>
78
#include <86box/nv/vid_nv_rivatimer.h>
89

src/unix/unix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <86box/device.h>
3939
#include <86box/gameport.h>
4040
#include <86box/unix_sdl.h>
41+
#include "cpu.h"
4142
#include <86box/timer.h>
4243
#include <86box/nvr.h>
4344
#include <86box/version.h>

src/video/vid_ati_mach64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <86box/device.h>
2929
#include <86box/io.h>
3030
#include <86box/mem.h>
31+
#include "cpu.h"
3132
#include <86box/timer.h>
3233
#include <86box/pci.h>
3334
#include <86box/rom.h>

src/video/vid_ati_mach8.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <86box/device.h>
2828
#include <86box/io.h>
2929
#include <86box/mem.h>
30+
#include "cpu.h"
3031
#include <86box/timer.h>
3132
#include <86box/mca.h>
3233
#include <86box/pci.h>

src/video/vid_chips_69000.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <86box/mem.h>
2828
#include <86box/rom.h>
2929
#include <86box/device.h>
30+
#include "cpu.h"
3031
#include <86box/timer.h>
3132
#include <86box/video.h>
3233
#include <86box/vid_svga.h>

src/video/vid_mga.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <stdatomic.h>
2424
#include <86box/86box.h>
2525
#include <86box/io.h>
26+
#include "cpu.h"
2627
#include <86box/timer.h>
2728
#include <86box/mem.h>
2829
#include <86box/pci.h>

src/video/vid_nga.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <86box/io.h>
3131
#include <86box/video.h>
3232
#include <86box/86box.h>
33+
#include "cpu.h"
3334
#include <86box/timer.h>
3435
#include <86box/mem.h>
3536
#include <86box/pit.h>

src/video/vid_ogc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <86box/io.h>
3232
#include <86box/video.h>
3333
#include <86box/86box.h>
34+
#include "cpu.h"
3435
#include <86box/timer.h>
3536
#include <86box/mem.h>
3637
#include <86box/pit.h>

src/video/vid_table.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ video_cards[] = {
141141
{ .device = &chips_69000_device, .flags = VIDEO_FLAG_TYPE_NONE },
142142
{ .device = &gd5430_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },
143143
{ .device = &gd5434_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },
144-
{ .device = &gd5436_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL },
144+
{ .device = &gd5436_pci_device, .flags = VIDEO_FLAG_TYPE_SECONDARY },
145145
{ .device = &gd5440_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },
146-
{ .device = &gd5446_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL },
147-
{ .device = &gd5446_stb_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL },
146+
{ .device = &gd5446_pci_device, .flags = VIDEO_FLAG_TYPE_SECONDARY },
147+
{ .device = &gd5446_stb_pci_device, .flags = VIDEO_FLAG_TYPE_SECONDARY },
148148
{ .device = &gd5480_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },
149149
{ .device = &et4000w32p_videomagic_revb_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },
150150
{ .device = &et4000w32p_revc_pci_device, .flags = VIDEO_FLAG_TYPE_NONE },

0 commit comments

Comments
 (0)