Skip to content

Commit

Permalink
Clean up includes
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 11, 2023
1 parent a409b70 commit 25e76ab
Show file tree
Hide file tree
Showing 88 changed files with 203 additions and 206 deletions.
4 changes: 2 additions & 2 deletions cpp/base/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//---------------------------------------------------------------------------

#include "shared/s2p_version.h"
#include "device.h"
#include <spdlog/spdlog.h>
#include <cassert>
#include <stdexcept>
#include "shared/s2p_version.h"
#include "device.h"

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions cpp/base/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#pragma once

#include "generated/s2p_interface.pb.h"
#include "shared/s2p_util.h"
#include <unordered_map>
#include <string>
#include "generated/s2p_interface.pb.h"
#include "shared/s2p_util.h"

using namespace std;
using namespace s2p_interface;
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/device_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#pragma once

#include "spdlog/spdlog.h"
#include <string>
#include "spdlog/spdlog.h"

using namespace std;

Expand Down
8 changes: 4 additions & 4 deletions cpp/base/primary_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

#pragma once

#include "interfaces/scsi_primary_commands.h"
#include "controllers/abstract_controller.h"
#include "device.h"
#include "device_logger.h"
#include <string>
#include <unordered_map>
#include <span>
#include <functional>
#include "interfaces/scsi_primary_commands.h"
#include "controllers/abstract_controller.h"
#include "device.h"
#include "device_logger.h"

using namespace std;
using namespace scsi_defs;
Expand Down
4 changes: 2 additions & 2 deletions cpp/base/scsi_command_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//
//---------------------------------------------------------------------------

#include "shared/shared_exceptions.h"
#include "scsi_command_util.h"
#include <spdlog/spdlog.h>
#include <cstring>
#include "shared/shared_exceptions.h"
#include "scsi_command_util.h"

using namespace scsi_defs;

Expand Down
2 changes: 1 addition & 1 deletion cpp/base/scsi_command_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

#pragma once

#include "shared/scsi.h"
#include <cstdint>
#include <cassert>
#include <span>
#include <vector>
#include <map>
#include "shared/scsi.h"

using namespace std;

Expand Down
16 changes: 2 additions & 14 deletions cpp/buses/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@

#pragma once

#include "buses/pin_control.h"
#include "shared/scsi.h"
#include <string>
#include <array>
#include <cstdint>
#include <memory>
#include <unordered_map>
#include <vector>

#ifdef __linux__
// Check SEL signal by event
#define USE_SEL_EVENT_ENABLE
#endif

// Do not disable IRQs
#define NO_IRQ_DISABLE

#ifndef __linux__
#define NO_IRQ_DISABLE
#endif
#include "buses/pin_control.h"
#include "shared/scsi.h"

using namespace std;
using namespace scsi_defs;
Expand Down
4 changes: 2 additions & 2 deletions cpp/buses/bus_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//---------------------------------------------------------------------------

#include "bus_factory.h"
#include "buses/rpi_bus.h"
#include <spdlog/spdlog.h>
#include <sstream>
#include <fstream>
#include "bus_factory.h"
#include "rpi_bus.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion cpp/buses/bus_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#pragma once

#include "buses/in_process_bus.h"
#include <string>
#include "buses/in_process_bus.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion cpp/buses/gpio_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
//
//---------------------------------------------------------------------------

#include "buses/gpio_bus.h"
#ifdef __linux__
#include <sys/epoll.h>
#endif
#include <chrono>
#include "gpio_bus.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion cpp/buses/gpio_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

#pragma once

#include "buses/bus.h"
#include <spdlog/spdlog.h>
#include <memory>
#include <vector>
#include "buses/bus.h"

//---------------------------------------------------------------------------
//
Expand Down
2 changes: 1 addition & 1 deletion cpp/buses/in_process_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//---------------------------------------------------------------------------

#include "buses/in_process_bus.h"
#include <spdlog/spdlog.h>
#include "in_process_bus.h"

void InProcessBus::Reset()
{
Expand Down
7 changes: 2 additions & 5 deletions cpp/buses/rpi_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
//
//---------------------------------------------------------------------------

#include "buses/rpi_bus.h"
#include <spdlog/spdlog.h>
#include <map>
#include <cstring>
#ifdef USE_SEL_EVENT_ENABLE
#include <sys/epoll.h>
#endif
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <spdlog/spdlog.h>
#include "rpi_bus.h"

//---------------------------------------------------------------------------
//
Expand Down
17 changes: 16 additions & 1 deletion cpp/buses/rpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@

#pragma once

// Configurable settings
#ifdef __linux__
// Check SEL signal by event instead of polling
#define USE_SEL_EVENT_ENABLE
#endif
// Do not disable IRQs
#define NO_IRQ_DISABLE

#ifndef __linux__
#define NO_IRQ_DISABLE
#endif

#ifdef __linux__
#include <linux/gpio.h>
#endif
#include "buses/gpio_bus.h"
#ifdef USE_SEL_EVENT_ENABLE
#include <sys/epoll.h>
#endif
#include "gpio_bus.h"

// Constant declarations (GIC)
const static uint32_t ARM_GICD_BASE = 0xFF841000;
Expand Down
4 changes: 2 additions & 2 deletions cpp/controllers/abstract_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//---------------------------------------------------------------------------

#include <cstring>
#include <ranges>
#include "shared/shared_exceptions.h"
#include "base/primary_device.h"
#include "abstract_controller.h"
#include <cstring>
#include <ranges>

using namespace scsi_defs;

Expand Down
6 changes: 3 additions & 3 deletions cpp/controllers/abstract_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

#pragma once

#include "buses/bus.h"
#include "phase_handler.h"
#include "base/device_logger.h"
#include <unordered_set>
#include <unordered_map>
#include <span>
#include <vector>
#include "buses/bus.h"
#include "phase_handler.h"
#include "base/device_logger.h"

using namespace std;

Expand Down
6 changes: 3 additions & 3 deletions cpp/controllers/controller_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include "buses/bus.h"
#include "base/primary_device.h"
#include "abstract_controller.h"
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include "buses/bus.h"
#include "base/primary_device.h"
#include "abstract_controller.h"

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions cpp/controllers/phase_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#pragma once

#include "shared/scsi.h"
#include "shared/shared_exceptions.h"
#include <unordered_map>
#include <functional>
#include "shared/scsi.h"
#include "shared/shared_exceptions.h"

class PhaseHandler
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/controllers/scsi_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#pragma once

#include "generic_controller.h"
#include <array>
#include "generic_controller.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/cd_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//
//---------------------------------------------------------------------------

#include "cd_track.h"
#include <cassert>
#include "cd_track.h"

void CDTrack::Init(int track, uint32_t first, uint32_t last)
{
Expand Down
6 changes: 3 additions & 3 deletions cpp/devices/ctapdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
//
//---------------------------------------------------------------------------

#include "shared/s2p_util.h"
#include "shared/network_util.h"
#include "ctapdriver.h"
#include <unistd.h>
#include <poll.h>
#include <arpa/inet.h>
Expand All @@ -23,6 +20,9 @@
#include <linux/if_tun.h>
#include <linux/sockios.h>
#endif
#include "shared/s2p_util.h"
#include "shared/network_util.h"
#include "ctapdriver.h"

using namespace std;
using namespace s2p_util;
Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/ctapdriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

#pragma once

#include "base/device.h"
#include <vector>
#include <string>
#include <span>
#include "base/device.h"

#ifndef ETH_FRAME_LEN
static const int ETH_FRAME_LEN = 1514;
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/daynaport.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

#pragma once

#include "base/primary_device.h"
#include "ctapdriver.h"
#ifndef __NetBSD__
#include <net/ethernet.h>
#endif
#include <string>
#include <span>
#include <unordered_map>
#include <array>
#include "base/primary_device.h"
#include "ctapdriver.h"

class SCSIDaynaPort : public PrimaryDevice
{
Expand Down
10 changes: 5 additions & 5 deletions cpp/devices/disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

#pragma once

#include "shared/s2p_util.h"
#include "disk_track.h"
#include "disk_cache.h"
#include "base/interfaces/scsi_block_commands.h"
#include "storage_device.h"
#include <string>
#include <span>
#include <unordered_set>
#include <unordered_map>
#include <tuple>
#include "base/interfaces/scsi_block_commands.h"
#include "shared/s2p_util.h"
#include "disk_track.h"
#include "disk_cache.h"
#include "storage_device.h"

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/disk_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
//
//---------------------------------------------------------------------------

#include "disk_track.h"
#include "disk_cache.h"
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include "disk_track.h"
#include "disk_cache.h"

DiskCache::DiskCache(const string &path, int size, uint32_t blocks, off_t imgoff)
: sec_path(path), sec_size(size), sec_blocks(blocks), imgoffset(imgoff)
Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/disk_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

#pragma once

#include "generated/s2p_interface.pb.h"
#include <span>
#include <array>
#include <memory>
#include <string>
#include "generated/s2p_interface.pb.h"

using namespace std;
using namespace s2p_interface;
Expand Down
Loading

0 comments on commit 25e76ab

Please sign in to comment.