aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-4.9/212-byteshift_portability.patch
blob: 6def12d0cf749e5c2aa6ef93daf939ad44c695dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.hi
From 48232d3d931c95953ce2ddfe7da7bb164aef6a73 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 17:03:16 +0200
Subject: linux-3.6: fix portability of some includes files in tools/ used on the host

lede-commit: 6040b1d29ab1f047c5e49b748abcb6a3196add28
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 tools/include/tools/be_byteshift.h |  4 ++++
 tools/include/tools/le_byteshift.h |  4 ++++
 tools/include/tools/linux_types.h  | 22 ++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 tools/include/tools/linux_types.h

--- a/tools/include/tools/be_byteshift.h
+++ b/tools/include/tools/be_byteshift.h
@@ -1,6 +1,10 @@
 #ifndef _TOOLS_BE_BYTESHIFT_H
 #define _TOOLS_BE_BYTESHIFT_H
 
+#ifndef __linux__
+#include "linux_types.h"
+#endif
+
 #include <stdint.h>
 
 static inline uint16_t __get_unaligned_be16(const uint8_t *p)
--- a/tools/include/tools/le_byteshift.h
+++ b/tools/include/tools/le_byteshift.h
@@ -1,6 +1,10 @@
 #ifndef _TOOLS_LE_BYTESHIFT_H
 #define _TOOLS_LE_BYTESHIFT_H
 
+#ifndef __linux__
+#include "linux_types.h"
+#endif
+
 #include <stdint.h>
 
 static inline uint16_t __get_unaligned_le16(const uint8_t *p)
--- /dev/null
+++ b/tools/include/tools/linux_types.h
@@ -0,0 +1,22 @@
+#ifndef __LINUX_TYPES_H
+#define __LINUX_TYPES_H
+
+#include <stdint.h>
+
+typedef uint8_t __u8;
+typedef uint8_t __be8;
+typedef uint8_t __le8;
+
+typedef uint16_t __u16;
+typedef uint16_t __be16;
+typedef uint16_t __le16;
+
+typedef uint32_t __u32;
+typedef uint32_t __be32;
+typedef uint32_t __le32;
+
+typedef uint64_t __u64;
+typedef uint64_t __be64;
+typedef uint64_t __le64;
+
+#endif
provided then it lists the ports on the top module.\n"); log("\n"); log(" -m\n"); log(" print verilog blackbox module definitions instead of port lists\n"); log("\n"); } void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE { bool m_mode = false; size_t argidx; for (argidx = 1; argidx < args.size(); argidx++) { if (args[argidx] == "-m") { m_mode = true; continue; } break; } bool first_module = true; auto handle_module = [&](RTLIL::Module *module) { vector<string> ports; if (first_module) first_module = false; else log("\n"); for (auto port : module->ports) { auto *w = module->wire(port); ports.push_back(stringf("%s [%d:%d] %s", w->port_input ? w->port_output ? "inout" : "input" : "output", w->upto ? w->start_offset : w->start_offset + w->width - 1, w->upto ? w->start_offset + w->width - 1 : w->start_offset, log_id(w))); } log("module %s%s\n", log_id(module), m_mode ? " (" : ""); for (int i = 0; i < GetSize(ports); i++) log("%s%s\n", ports[i].c_str(), m_mode && i+1 < GetSize(ports) ? "," : ""); if (m_mode) log(");\nendmodule\n"); }; if (argidx == args.size()) { auto *top = design->top_module(); if (top == nullptr) log_cmd_error("Can't find top module in current design!\n"); handle_module(top); } else { extra_args(args, argidx, design); for (auto module : design->selected_modules()) handle_module(module); } } } PortlistPass; PRIVATE_NAMESPACE_END