From 5fa6dae9df391c386d729b6461be987504a7eaff Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 18 Apr 2018 15:49:53 -0700 Subject: [PATCH 1/4] Disable style check for now. Fixes #242 Change-Id: I4d151350bf26bd3ea7733cb5247e4990fb487194 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2aeed080b..f110fe16a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,6 @@ script: # 50 changes any case. Most merges won't consist of more than 40 changes, # so this should work fine most of the time, and be a lot better than not # checking at all. - - git diff HEAD~40 | ./tools/scripts/checkpatch.pl --no-signoff - + #- git diff HEAD~40 | ./tools/scripts/checkpatch.pl --no-signoff - - ./bootstrap && ./configure --enable-remote-bitbang --enable-jtag_vpi $CONFIGURE_ARGS && make - file src/$EXECUTABLE From b5dae238a15d1dd964f7a3ecbe55631e5834e883 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 18 Apr 2018 16:01:38 -0700 Subject: [PATCH 2/4] Fix comments in encoding.h. This was updated in the source a long time ago: https://github.com/riscv/riscv-opcodes/commit/25881d8a221393cfd996ec074d8003ef31bfc5a6 Change-Id: Ia158205d046522c6802a3a32b330759f5e65566f --- src/target/riscv/encoding.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/target/riscv/encoding.h b/src/target/riscv/encoding.h index c109ce189..dadbbd0b9 100644 --- a/src/target/riscv/encoding.h +++ b/src/target/riscv/encoding.h @@ -1,4 +1,4 @@ -// See LICENSE for license details. +/* See LICENSE for license details. */ #ifndef RISCV_CSR_ENCODING_H #define RISCV_CSR_ENCODING_H @@ -156,16 +156,16 @@ #define EXT_IO_BASE 0x40000000 #define DRAM_BASE 0x80000000 -// page table entry (PTE) fields -#define PTE_V 0x001 // Valid -#define PTE_R 0x002 // Read -#define PTE_W 0x004 // Write -#define PTE_X 0x008 // Execute -#define PTE_U 0x010 // User -#define PTE_G 0x020 // Global -#define PTE_A 0x040 // Accessed -#define PTE_D 0x080 // Dirty -#define PTE_SOFT 0x300 // Reserved for Software +/* page table entry (PTE) fields */ +#define PTE_V 0x001 /* Valid */ +#define PTE_R 0x002 /* Read */ +#define PTE_W 0x004 /* Write */ +#define PTE_X 0x008 /* Execute */ +#define PTE_U 0x010 /* User */ +#define PTE_G 0x020 /* Global */ +#define PTE_A 0x040 /* Accessed */ +#define PTE_D 0x080 /* Dirty */ +#define PTE_SOFT 0x300 /* Reserved for Software */ #define PTE_PPN_SHIFT 10 From ba2174249daf80775c7759ab04c7a2d7c9f01378 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 18 Apr 2018 16:10:24 -0700 Subject: [PATCH 3/4] Make encoding.h pass style guide. There's a manual step in commenting this out, but this file changes very rarely. Change-Id: I332d6490940ecc81e18c3b112a7ba415331b9c86 --- src/target/riscv/encoding.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/target/riscv/encoding.h b/src/target/riscv/encoding.h index dadbbd0b9..e214c0ca0 100644 --- a/src/target/riscv/encoding.h +++ b/src/target/riscv/encoding.h @@ -191,6 +191,7 @@ #ifdef __GNUC__ +/* #define read_csr(reg) ({ unsigned long __tmp; \ asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \ __tmp; }) @@ -209,6 +210,7 @@ #define clear_csr(reg, bit) ({ unsigned long __tmp; \ asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "rK"(bit)); \ __tmp; }) + */ #define rdtime() read_csr(time) #define rdcycle() read_csr(cycle) From dc8c5eeac9952565fd7133c900229dceb576c29c Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 18 Apr 2018 16:19:18 -0700 Subject: [PATCH 4/4] Re-enable style check. Tell git to give us 20 lines of context, which hopefully is enough to deal with some spurious warnings. Change-Id: I97cb572f7b89ff305f46290d20ed0b4674af1f5b --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f110fe16a..88a6b8de7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,6 @@ script: # 50 changes any case. Most merges won't consist of more than 40 changes, # so this should work fine most of the time, and be a lot better than not # checking at all. - #- git diff HEAD~40 | ./tools/scripts/checkpatch.pl --no-signoff - + - git diff -U20 HEAD~40 | ./tools/scripts/checkpatch.pl --no-signoff - - ./bootstrap && ./configure --enable-remote-bitbang --enable-jtag_vpi $CONFIGURE_ARGS && make - file src/$EXECUTABLE