Skip to content

Commit

Permalink
inmates: reserve memory for inmate cmdlines as weak symbol
Browse files Browse the repository at this point in the history
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 <ralf.ramsauer@oth-regensburg.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
rralf authored and jan-kiszka committed Dec 2, 2016
1 parent c3c645d commit d18fe64
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 14 deletions.
3 changes: 0 additions & 3 deletions inmates/demos/arm/gic-demo.c
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions inmates/demos/x86/apic-demo.c
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion inmates/lib/cmdline.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion inmates/lib/inmate_common.h
Expand Up @@ -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);

Expand Down
3 changes: 0 additions & 3 deletions inmates/tools/arm/linux-loader.c
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions inmates/tools/arm64/linux-loader.c
Expand Up @@ -12,9 +12,6 @@

#include <inmate.h>

#define CMDLINE_BUFFER_SIZE 256
CMDLINE_BUFFER(CMDLINE_BUFFER_SIZE);

void inmate_main(void)
{
unsigned long dtb;
Expand Down

0 comments on commit d18fe64

Please sign in to comment.