Skip to content

Commit

Permalink
Code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 24, 2023
1 parent 668cc96 commit 216b585
Show file tree
Hide file tree
Showing 42 changed files with 62 additions and 270 deletions.
8 changes: 4 additions & 4 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ ifeq ($(CONNECT_TYPE), FULLSPEC)
BIN_ALL += $(BINDIR)/$(SCSIEXEC)
endif

SRC_PROTOC = piscsi_interface.proto
SRC_PROTOC = scsi2pi_interface.proto

SRC_GENERATED = $(GENERATED_DIR)/piscsi_interface.pb.cpp
SRC_GENERATED = $(GENERATED_DIR)/scsi2pi_interface.pb.cpp

SRC_PROTOBUF = \
shared/protobuf_util.cpp
Expand Down Expand Up @@ -158,7 +158,7 @@ $(OBJDIR)/%.o: %.cpp | $(OBJDIR)
$(SRC_GENERATED) : $(SRC_PROTOC)
mkdir -p $(GENERATED_DIR)
protoc --cpp_out=$(GENERATED_DIR) $(SRC_PROTOC)
mv $(GENERATED_DIR)/piscsi_interface.pb.cc $@
mv $(GENERATED_DIR)/scsi2pi_interface.pb.cc $@

$(OBJ_GENERATED) : $(SRC_GENERATED) | $(OBJDIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
Expand Down Expand Up @@ -187,7 +187,7 @@ coverage: test

lcov: CXXFLAGS += --coverage
lcov: test
lcov -q -c -d . --include '*/cpp/*' -o $(COVERAGE_FILE) --exclude '*/test/*' --exclude '*/interfaces/*' --exclude '*/piscsi_interface.pb*'
lcov -q -c -d . --include '*/cpp/*' -o $(COVERAGE_FILE) --exclude '*/test/*' --exclude '*/interfaces/*' --exclude '*/scsi2pi_interface.pb*'
genhtml -q -o $(COVERAGE_DIR) --legend $(COVERAGE_FILE)

docs: $(DOC_DIR)/piscsi_man_page.txt $(DOC_DIR)/scsictl_man_page.txt $(DOC_DIR)/scsidump_man_page.txt
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include "shared/piscsi_util.h"
#include <unordered_map>
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

// A combination of device ID and LUN
using id_set = pair<int, int>;
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/device_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

#include <string>
#include <unordered_map>
#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include "shared/piscsi_util.h"

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class PrimaryDevice;

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

#pragma once

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

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class DiskCache
{
Expand Down
6 changes: 3 additions & 3 deletions cpp/devices/host_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
// | 9 | Control |
// +==============================================================================
//
// The piscsi commands that can be executed are defined in the piscsi_interface.proto file.
// The piscsi commands that can be executed are defined in the scsi2pi_interface.proto file.
// The BIN, JSON and TEXT flags control the input and output format of the protobuf data.
// Exactly one of them must be set. Input and output format do not have to be identical.
// ReceiveOperationResults returns the result of the last operation executed.
Expand All @@ -86,7 +86,7 @@
#include "controllers/scsi_controller.h"
#include "scsi_command_util.h"
#include "host_services.h"
#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include <google/protobuf/util/json_util.h>
#include <google/protobuf/text_format.h>
#include <algorithm>
Expand All @@ -95,7 +95,7 @@
using namespace std::chrono;
using namespace google::protobuf;
using namespace google::protobuf::util;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace scsi_defs;
using namespace scsi_command_util;
using namespace protobuf_util;
Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/host_services.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <map>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class HostServices: public ModePageDevice
{
Expand Down
4 changes: 2 additions & 2 deletions cpp/hal/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#pragma once

#include "hal/data_sample.h"
#include "hal/pin_control.h"
#include "shared/scsi.h"
#include "shared/config.h"
#include "shared/scsi.h"
#include <string>
Expand All @@ -22,6 +22,7 @@
#include <vector>

using namespace std;
using namespace scsi_defs;

// SCSI Bus timings taken from https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-05.html
const static int SCSI_DELAY_ARBITRATION_DELAY_NS = 2400;
Expand Down Expand Up @@ -73,7 +74,6 @@ class BUS : public PinControl
static string GetPhaseName(phase_t);

virtual uint32_t Acquire() = 0;
virtual unique_ptr<DataSample> GetSample(uint64_t = 0) = 0;
virtual int CommandHandShake(vector<uint8_t> &) = 0;
virtual int ReceiveHandShake(uint8_t *, int) = 0;
virtual int SendHandShake(uint8_t *, int, int = SEND_NO_DELAY) = 0;
Expand Down
40 changes: 0 additions & 40 deletions cpp/hal/data_sample.cpp

This file was deleted.

53 changes: 0 additions & 53 deletions cpp/hal/data_sample.h

This file was deleted.

101 changes: 0 additions & 101 deletions cpp/hal/data_sample_raspberry.h

This file was deleted.

11 changes: 2 additions & 9 deletions cpp/hal/gpiobus_raspberry.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

#pragma once

#include "hal/data_sample_raspberry.h"
#include "hal/gpiobus.h"
#include "shared/scsi.h"

// Constant declarations (GIC)
const static uint32_t ARM_GICD_BASE = 0xFF841000;
Expand All @@ -38,7 +36,8 @@ const static int GICC_EOIR = 0x004;

// Constant declarations (GIC IRQ)
const static int GIC_IRQLOCAL0 = (16 + 14);
const static int GIC_GPIO_IRQ = (32 + 116); // GPIO3
// GPIO3
const static int GIC_GPIO_IRQ = (32 + 116);

class GPIOBUS_Raspberry : public GPIOBUS
{
Expand Down Expand Up @@ -95,12 +94,6 @@ class GPIOBUS_Raspberry : public GPIOBUS
}
static uint32_t bcm_host_get_peripheral_address();

unique_ptr<DataSample> GetSample(uint64_t timestamp) override
{
Acquire();
return make_unique<DataSample_Raspberry>(signals, timestamp);
}

protected:

// All bus signals
Expand Down
6 changes: 0 additions & 6 deletions cpp/hal/in_process_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ class InProcessBus: public GPIOBUS
assert(false);
}

unique_ptr<DataSample> GetSample(uint64_t) override
{
assert(false);
return nullptr;
}

mutex write_locker;

atomic<uint8_t> dat = 0;
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/command_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <iostream>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace protobuf_util;

bool CommandContext::ReadCommand()
Expand Down
Loading

0 comments on commit 216b585

Please sign in to comment.