Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167862
b: refs/heads/master
c: 171fb12
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell authored and Benjamin Herrenschmidt committed Oct 27, 2009
1 parent 35c0fcc commit 2a459a8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7abb840b496f834a71a8943bb189683da320f047
refs/heads/master: 171fb12570b479723c49ef9f8911e40e516f3394
11 changes: 1 addition & 10 deletions trunk/arch/powerpc/platforms/iseries/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
EXTRA_CFLAGS += -mno-minimal-toc

extra-y += dt.o

obj-y += exception.o
obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt.o mf.o lpevents.o \
hvcall.o proc.o htab.o iommu.o misc.o irq.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_VIOPATH) += viopath.o vio.o
obj-$(CONFIG_MODULES) += ksyms.o

quiet_cmd_dt_strings = DT_STR $@
cmd_dt_strings = $(OBJCOPY) --rename-section .rodata.str1.8=.dt_strings \
$< $@

$(obj)/dt_mod.o: $(obj)/dt.o
$(call if_changed,dt_strings)
56 changes: 24 additions & 32 deletions trunk/arch/powerpc/platforms/iseries/dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@

/*
* These are created by the linker script at the start and end
* of the section containing all the strings from this file.
* of the section containing all the strings marked with the DS macro.
*/
extern char __dt_strings_start[];
extern char __dt_strings_end[];

#define DS(s) ({ \
static const char __s[] __attribute__((section(".dt_strings"))) = s; \
__s; \
})

struct iseries_flat_dt {
struct boot_param_header header;
u64 reserve_map[2];
Expand All @@ -64,9 +69,8 @@ struct iseries_flat_dt {
static void * __initdata dt_data;

/*
* Putting these strings here keeps them out of the section
* that we rename to .dt_strings using objcopy and capture
* for the strings blob of the flattened device tree.
* Putting these strings here keeps them out of the .dt_strings section
* that we capture for the strings blob of the flattened device tree.
*/
static char __initdata device_type_cpu[] = "cpu";
static char __initdata device_type_memory[] = "memory";
Expand Down Expand Up @@ -173,7 +177,7 @@ static void __init dt_start_node(struct iseries_flat_dt *dt, const char *name)

#define dt_end_node(dt) dt_push_u32(dt, OF_DT_END_NODE)

static void __init dt_prop(struct iseries_flat_dt *dt, const char *name,
static void __init __dt_prop(struct iseries_flat_dt *dt, const char *name,
const void *data, int len)
{
unsigned long offset;
Expand All @@ -191,44 +195,32 @@ static void __init dt_prop(struct iseries_flat_dt *dt, const char *name,
/* The actual data. */
dt_push_bytes(dt, data, len);
}
#define dt_prop(dt, name, data, len) __dt_prop((dt), DS(name), (data), (len))

static void __init dt_prop_str(struct iseries_flat_dt *dt, const char *name,
const char *data)
{
dt_prop(dt, name, data, strlen(data) + 1); /* + 1 for NULL */
}
#define dt_prop_str(dt, name, data) \
dt_prop((dt), name, (data), strlen((data)) + 1); /* + 1 for NULL */

static void __init dt_prop_u32(struct iseries_flat_dt *dt, const char *name,
static void __init __dt_prop_u32(struct iseries_flat_dt *dt, const char *name,
u32 data)
{
dt_prop(dt, name, &data, sizeof(u32));
__dt_prop(dt, name, &data, sizeof(u32));
}
#define dt_prop_u32(dt, name, data) __dt_prop_u32((dt), DS(name), (data))

static void __init __maybe_unused dt_prop_u64(struct iseries_flat_dt *dt,
const char *name,
u64 data)
static void __init __maybe_unused __dt_prop_u64(struct iseries_flat_dt *dt,
const char *name, u64 data)
{
dt_prop(dt, name, &data, sizeof(u64));
__dt_prop(dt, name, &data, sizeof(u64));
}
#define dt_prop_u64(dt, name, data) __dt_prop_u64((dt), DS(name), (data))

static void __init dt_prop_u64_list(struct iseries_flat_dt *dt,
const char *name, u64 *data, int n)
{
dt_prop(dt, name, data, sizeof(u64) * n);
}
#define dt_prop_u64_list(dt, name, data, n) \
dt_prop((dt), name, (data), sizeof(u64) * (n))

static void __init dt_prop_u32_list(struct iseries_flat_dt *dt,
const char *name, u32 *data, int n)
{
dt_prop(dt, name, data, sizeof(u32) * n);
}
#define dt_prop_u32_list(dt, name, data, n) \
dt_prop((dt), name, (data), sizeof(u32) * (n))

#ifdef notyet
static void __init dt_prop_empty(struct iseries_flat_dt *dt, const char *name)
{
dt_prop(dt, name, NULL, 0);
}
#endif
#define dt_prop_empty(dt, name) dt_prop((dt), name, NULL, 0)

static void __init dt_cpus(struct iseries_flat_dt *dt)
{
Expand Down

0 comments on commit 2a459a8

Please sign in to comment.