This reserves at least 256 byte of memory for inmates.

Inmates may still use CMDLINE_BUFFER() to override this default setting.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 inmates/demos/arm/gic-demo.c       | 3 ---
 inmates/demos/x86/apic-demo.c      | 3 ---
 inmates/lib/cmdline.c              | 3 ++-
 inmates/lib/inmate_common.h        | 2 +-
 inmates/tools/arm/linux-loader.c   | 3 ---
 inmates/tools/arm64/linux-loader.c | 3 ---
 6 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/inmates/demos/arm/gic-demo.c b/inmates/demos/arm/gic-demo.c
index 57626e7c1e..85e83fe1f5 100644
--- a/inmates/demos/arm/gic-demo.c
+++ b/inmates/demos/arm/gic-demo.c
@@ -15,9 +15,6 @@
 #include <mach/timer.h>
 #include <inmate.h>
 
-#define CMDLINE_BUFFER_SIZE    256
-CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE);
-
 #define BEATS_PER_SEC          10
 
 static u64 ticks_per_beat;
diff --git a/inmates/demos/x86/apic-demo.c b/inmates/demos/x86/apic-demo.c
index 272a5d1772..e501203755 100644
--- a/inmates/demos/x86/apic-demo.c
+++ b/inmates/demos/x86/apic-demo.c
@@ -12,9 +12,6 @@
 
 #include <inmate.h>
 
-#define CMDLINE_BUFFER_SIZE    256
-CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE);
-
 #define POLLUTE_CACHE_SIZE     (512 * 1024)
 
 #ifdef CONFIG_SERIAL_OXPCIE952
diff --git a/inmates/lib/cmdline.c b/inmates/lib/cmdline.c
index bcbedb02a5..f6dc79c260 100644
--- a/inmates/lib/cmdline.c
+++ b/inmates/lib/cmdline.c
@@ -12,7 +12,8 @@
 
 #include <inmate.h>
 
-extern const char cmdline[];
+#define CMDLINE_BUFFER_SIZE 256
+CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE) __attribute__((weak));
 
 static bool get_param(const char *param, char *value_buffer,
                      unsigned long buffer_size)
diff --git a/inmates/lib/inmate_common.h b/inmates/lib/inmate_common.h
index 475c2312f0..1a27b1ae6c 100644
--- a/inmates/lib/inmate_common.h
+++ b/inmates/lib/inmate_common.h
@@ -50,7 +50,7 @@ long long cmdline_parse_int(const char *param, long long 
default_value);
 bool cmdline_parse_bool(const char *param);
 
 #define CMDLINE_BUFFER(size) \
-       const char cmdline[size] __attribute__((section(".cmdline")));
+       const char cmdline[size] __attribute__((section(".cmdline")))
 
 void inmate_main(void);
 
diff --git a/inmates/tools/arm/linux-loader.c b/inmates/tools/arm/linux-loader.c
index f6c434c746..0fe56b63a6 100644
--- a/inmates/tools/arm/linux-loader.c
+++ b/inmates/tools/arm/linux-loader.c
@@ -14,9 +14,6 @@
 
 #include <inmate.h>
 
-#define CMDLINE_BUFFER_SIZE    256
-CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE);
-
 void inmate_main(void)
 {
        void register (*entry)(unsigned long, unsigned long, unsigned long);
diff --git a/inmates/tools/arm64/linux-loader.c 
b/inmates/tools/arm64/linux-loader.c
index 59cbeb03da..ca952ae719 100644
--- a/inmates/tools/arm64/linux-loader.c
+++ b/inmates/tools/arm64/linux-loader.c
@@ -12,9 +12,6 @@
 
 #include <inmate.h>
 
-#define CMDLINE_BUFFER_SIZE    256
-CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE);
-
 void inmate_main(void)
 {
        unsigned long dtb;
-- 
2.11.0.rc2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to