aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasushi SHOJI <yashi@spacecubics.com>2021-08-29 18:18:01 +0900
committerAntonio Borneo <borneo.antonio@gmail.com>2021-10-02 13:18:15 +0000
commit05752557dd0dcab76250ab12377d59435b74204d (patch)
tree52944824e93ab48977e7bb8f14e32337b63ac897
parente4872054108a3a18dc651b45dea679696e14ee7f (diff)
downloadriscv-openocd-05752557dd0dcab76250ab12377d59435b74204d.zip
riscv-openocd-05752557dd0dcab76250ab12377d59435b74204d.tar.gz
riscv-openocd-05752557dd0dcab76250ab12377d59435b74204d.tar.bz2
helper: Remove src/helper from include dirs
The header files under src/helper/ can currently be included with either #include <bits.h> or #include <helper/bits.h> This is because we specify both "src/" and "src/helper/" directories as include directories. Some files name under "src/helper/", such as types.h, log.h, and util.h are too generic and could be ambiguous depending on the search path. This commit remove "src/helper/" from our include dir and make C files include explicitly. Change-Id: I38fc9b96ba01a513d4a72757d40007e21b502f25 Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6507 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r--Makefile.am1
-rw-r--r--src/flash/nor/psoc6.c4
-rw-r--r--src/flash/nor/stm32l4x.c2
-rw-r--r--src/helper/command.h2
-rw-r--r--src/helper/jim-nvp.c2
-rw-r--r--src/jtag/drivers/libusb_helper.c2
-rw-r--r--src/rtos/rtos.h2
-rw-r--r--src/server/server.c2
-rw-r--r--src/target/armv7m_trace.h2
-rw-r--r--src/target/mips64_pracc.c2
-rw-r--r--src/target/riscv/riscv-011.c2
-rw-r--r--src/target/riscv/riscv-013.c2
-rw-r--r--src/target/riscv/riscv.c8
-rw-r--r--src/target/riscv/riscv_semihosting.c2
-rw-r--r--src/target/target_type.h2
15 files changed, 18 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am
index 3858093..7e5e229 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,6 @@ AM_CFLAGS = $(GCC_WARNINGS)
AM_CPPFLAGS = $(HOST_CPPFLAGS)\
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
- -I$(top_srcdir)/src/helper \
-DPKGDATADIR=\"$(pkgdatadir)\" \
-DBINDIR=\"$(bindir)\"
diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c
index a929d33..8a41219 100644
--- a/src/flash/nor/psoc6.c
+++ b/src/flash/nor/psoc6.c
@@ -24,12 +24,12 @@
#include <time.h>
#include "imp.h"
-#include <target/arm_adi_v5.h>
+#include "helper/time_support.h"
+#include "target/arm_adi_v5.h"
#include "target/target.h"
#include "target/cortex_m.h"
#include "target/breakpoints.h"
#include "target/target_type.h"
-#include "time_support.h"
#include "target/algorithm.h"
/**************************************************************************************************
diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index a363cd4..e5100a0 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -26,10 +26,10 @@
#include "imp.h"
#include <helper/align.h>
#include <helper/binarybuffer.h>
+#include <helper/bits.h>
#include <target/algorithm.h>
#include <target/arm_adi_v5.h>
#include <target/cortex_m.h>
-#include "bits.h"
#include "stm32l4x.h"
/* STM32L4xxx series for reference.
diff --git a/src/helper/command.h b/src/helper/command.h
index f387019..fb9e50c 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -24,8 +24,8 @@
#include <stdint.h>
#include <stdbool.h>
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
#include <helper/list.h>
#include <helper/types.h>
diff --git a/src/helper/jim-nvp.c b/src/helper/jim-nvp.c
index e21bc68..738ed79 100644
--- a/src/helper/jim-nvp.c
+++ b/src/helper/jim-nvp.c
@@ -41,8 +41,8 @@
* official policies, either expressed or implied, of the Jim Tcl Project.
*/
+#include "jim-nvp.h"
#include <string.h>
-#include <jim-nvp.h>
int jim_get_nvp(Jim_Interp *interp,
Jim_Obj *objptr, const struct jim_nvp *nvp_table, const struct jim_nvp **result)
diff --git a/src/jtag/drivers/libusb_helper.c b/src/jtag/drivers/libusb_helper.c
index f285bdc..3308d87 100644
--- a/src/jtag/drivers/libusb_helper.c
+++ b/src/jtag/drivers/libusb_helper.c
@@ -20,9 +20,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <helper/log.h>
#include <jtag/drivers/jtag_usb_common.h>
#include "libusb_helper.h"
-#include "log.h"
/*
* comment from libusb:
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index dc7a64f..8309de4 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -21,7 +21,7 @@
#include "server/server.h"
#include "target/target.h"
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
typedef int64_t threadid_t;
typedef int64_t symbol_address_t;
diff --git a/src/server/server.c b/src/server/server.c
index 64acd36..3f579bf 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -27,13 +27,13 @@
#endif
#include "server.h"
+#include <helper/time_support.h>
#include <target/target.h>
#include <target/target_request.h>
#include <target/openrisc/jsp_server.h>
#include "openocd.h"
#include "tcl_server.h"
#include "telnet_server.h"
-#include "time_support.h"
#include <signal.h>
diff --git a/src/target/armv7m_trace.h b/src/target/armv7m_trace.h
index eaee6a4..7e4977a 100644
--- a/src/target/armv7m_trace.h
+++ b/src/target/armv7m_trace.h
@@ -18,8 +18,8 @@
#ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
#define OPENOCD_TARGET_ARMV7M_TRACE_H
+#include <helper/command.h>
#include <target/target.h>
-#include <command.h>
/**
* @file
diff --git a/src/target/mips64_pracc.c b/src/target/mips64_pracc.c
index b2af39c..9583ad7 100644
--- a/src/target/mips64_pracc.c
+++ b/src/target/mips64_pracc.c
@@ -20,7 +20,7 @@
#include "mips64.h"
#include "mips64_pracc.h"
-#include "time_support.h"
+#include <helper/time_support.h>
#define STACK_DEPTH 32
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c
index 7a5e990..86a95f6 100644
--- a/src/target/riscv/riscv-011.c
+++ b/src/target/riscv/riscv-011.c
@@ -16,7 +16,7 @@
#include "target/target.h"
#include "target/algorithm.h"
#include "target/target_type.h"
-#include "log.h"
+#include <helper/log.h>
#include "jtag/jtag.h"
#include "target/register.h"
#include "target/breakpoints.h"
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 24fb79c..fdebdd4 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -16,7 +16,7 @@
#include "target/target.h"
#include "target/algorithm.h"
#include "target/target_type.h"
-#include "log.h"
+#include <helper/log.h>
#include "jtag/jtag.h"
#include "target/register.h"
#include "target/breakpoints.h"
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 8f1f398..07fb955 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -8,14 +8,14 @@
#include "config.h"
#endif
+#include <helper/log.h>
+#include <helper/time_support.h>
#include "target/target.h"
#include "target/algorithm.h"
#include "target/target_type.h"
-#include "log.h"
#include "jtag/jtag.h"
#include "target/register.h"
#include "target/breakpoints.h"
-#include "helper/time_support.h"
#include "riscv.h"
#include "gdb_regs.h"
#include "rtos/rtos.h"
@@ -1870,10 +1870,10 @@ static int riscv_checksum_memory(struct target *target,
LOG_DEBUG("address=0x%" TARGET_PRIxADDR "; count=0x%" PRIx32, address, count);
static const uint8_t riscv32_crc_code[] = {
-#include "../../contrib/loaders/checksum/riscv32_crc.inc"
+#include "contrib/loaders/checksum/riscv32_crc.inc"
};
static const uint8_t riscv64_crc_code[] = {
-#include "../../contrib/loaders/checksum/riscv64_crc.inc"
+#include "contrib/loaders/checksum/riscv64_crc.inc"
};
static const uint8_t *crc_code;
diff --git a/src/target/riscv/riscv_semihosting.c b/src/target/riscv/riscv_semihosting.c
index 90b8ddb..0072b9a 100644
--- a/src/target/riscv/riscv_semihosting.c
+++ b/src/target/riscv/riscv_semihosting.c
@@ -41,7 +41,7 @@
#include "config.h"
#endif
-#include "log.h"
+#include <helper/log.h>
#include "target/target.h"
#include "target/semihosting_common.h"
diff --git a/src/target/target_type.h b/src/target/target_type.h
index cf30cf8..d6b6086 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -25,7 +25,7 @@
#ifndef OPENOCD_TARGET_TARGET_TYPE_H
#define OPENOCD_TARGET_TARGET_TYPE_H
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
struct target;