diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-12-09 13:20:37 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-12-09 13:20:37 +1100 |
commit | 43d263b3eaa0d6cef59c87ca955cf0cd1e129589 (patch) | |
tree | 04474e97f1f45dbc656be7558419e1a70428640c | |
parent | c0639564589417a9208d0209794fc874a0603a1e (diff) | |
parent | f1a3a19d723524659bc91c8f65f3ed769a612c9b (diff) | |
download | skiboot-43d263b3eaa0d6cef59c87ca955cf0cd1e129589.zip skiboot-43d263b3eaa0d6cef59c87ca955cf0cd1e129589.tar.gz skiboot-43d263b3eaa0d6cef59c87ca955cf0cd1e129589.tar.bz2 |
Merge remote-tracking branch 'ltcgit/master'
-rw-r--r-- | Makefile.main | 4 | ||||
-rw-r--r-- | core/opal.c | 8 | ||||
-rw-r--r-- | core/test/run-malloc.c | 4 | ||||
-rw-r--r-- | core/test/run-mem_region_init.c | 6 | ||||
-rw-r--r-- | core/test/run-mem_region_release_unused.c | 6 | ||||
-rw-r--r-- | core/test/run-mem_region_release_unused_noalloc.c | 6 | ||||
-rw-r--r-- | core/test/stubs.c | 4 | ||||
-rw-r--r-- | hdata/memory.c | 6 | ||||
-rw-r--r-- | hdata/test/stubs.c | 4 | ||||
-rw-r--r-- | hw/occ.c | 6 | ||||
-rw-r--r-- | hw/psi.c | 2 | ||||
-rw-r--r-- | include/skiboot.h | 2 |
12 files changed, 39 insertions, 19 deletions
diff --git a/Makefile.main b/Makefile.main index 75ff7d1..e6ff0a6 100644 --- a/Makefile.main +++ b/Makefile.main @@ -23,8 +23,8 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Winit-self \ -Wsuggest-attribute=const \ -Wsuggest-attribute=noreturn \ - -Wframe-larger-than=2048 \ - -Wstack-usage=4096 + -Wframe-larger-than=1024 \ + -Wstack-usage=1024 # Host tools and options HOSTCC=gcc diff --git a/core/opal.c b/core/opal.c index 5b96064..044ff92 100644 --- a/core/opal.c +++ b/core/opal.c @@ -115,12 +115,14 @@ void __opal_register(uint64_t token, void *func, unsigned int nargs) static void add_opal_firmware_node(void) { struct dt_node *firmware = dt_new(opal_node, "firmware"); - + uint64_t sym_start = (uint64_t)__sym_map_start; + uint64_t sym_size = (uint64_t)__sym_map_end - sym_start; dt_add_property_string(firmware, "compatible", "ibm,opal-firmware"); dt_add_property_string(firmware, "name", "firmware"); dt_add_property_string(firmware, "version", version); - dt_add_property(firmware, "symbol-map", __sym_map_start, - __sym_map_end - __sym_map_start); + dt_add_property_cells(firmware, "symbol-map", + hi32(sym_start), lo32(sym_start), + hi32(sym_size), lo32(sym_size)); } void add_opal_node(void) diff --git a/core/test/run-malloc.c b/core/test/run-malloc.c index 345fb21..bbd2a48 100644 --- a/core/test/run-malloc.c +++ b/core/test/run-malloc.c @@ -79,6 +79,7 @@ int main(void) { char *test_heap = real_malloc(TEST_HEAP_SIZE); char *p, *p2, *p3, *p4; + char *pr; size_t i; /* Use malloc for the heap, so valgrind can find issues. */ @@ -169,7 +170,8 @@ int main(void) p3 = malloc(100); p4 = malloc(100); free(p2); - realloc(p,216); + pr = realloc(p,216); + assert(pr); free(p3); free(p); free(p4); diff --git a/core/test/run-mem_region_init.c b/core/test/run-mem_region_init.c index 65643ec..bb606ef 100644 --- a/core/test/run-mem_region_init.c +++ b/core/test/run-mem_region_init.c @@ -121,9 +121,9 @@ int main(void) dt_add_property_cells(dt_root, "#size-cells", 2); /* Make sure we overlap the heap, at least. */ - add_mem_node(0, heap + 0x100000000ULL); - add_mem_node(heap+0x100000000ULL , 0x100000000ULL); - end = heap+ 0x100000000ULL + 0x100000000ULL; + add_mem_node(0, (uint64_t)(heap + 0x100000000ULL)); + add_mem_node((uint64_t)heap+0x100000000ULL , 0x100000000ULL); + end = (uint64_t)(heap+ 0x100000000ULL + 0x100000000ULL); /* Now convert. */ mem_region_init(); diff --git a/core/test/run-mem_region_release_unused.c b/core/test/run-mem_region_release_unused.c index e73cf25..b8acffd 100644 --- a/core/test/run-mem_region_release_unused.c +++ b/core/test/run-mem_region_release_unused.c @@ -77,7 +77,10 @@ static void add_mem_node(uint64_t start, uint64_t len) { struct dt_node *mem; u64 reg[2]; - char name[sizeof("memory@") + STR_MAX_CHARS(reg[0])]; + char *name; + + name = (char*)malloc(sizeof("memory@") + STR_MAX_CHARS(reg[0])); + assert(name); /* reg contains start and length */ reg[0] = cpu_to_be64(start); @@ -88,6 +91,7 @@ static void add_mem_node(uint64_t start, uint64_t len) mem = dt_new(dt_root, name); dt_add_property_string(mem, "device_type", "memory"); dt_add_property(mem, "reg", reg, sizeof(reg)); + free(name); } void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused))) diff --git a/core/test/run-mem_region_release_unused_noalloc.c b/core/test/run-mem_region_release_unused_noalloc.c index 818e272..8dadddb 100644 --- a/core/test/run-mem_region_release_unused_noalloc.c +++ b/core/test/run-mem_region_release_unused_noalloc.c @@ -77,7 +77,10 @@ static void add_mem_node(uint64_t start, uint64_t len) { struct dt_node *mem; u64 reg[2]; - char name[sizeof("memory@") + STR_MAX_CHARS(reg[0])]; + char *name; + + name = (char*)malloc(sizeof("memory@") + STR_MAX_CHARS(reg[0])); + assert(name); /* reg contains start and length */ reg[0] = cpu_to_be64(start); @@ -88,6 +91,7 @@ static void add_mem_node(uint64_t start, uint64_t len) mem = dt_new(dt_root, name); dt_add_property_string(mem, "device_type", "memory"); dt_add_property(mem, "reg", reg, sizeof(reg)); + free(name); } void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused))) diff --git a/core/test/stubs.c b/core/test/stubs.c index 57c5917..2ab04f6 100644 --- a/core/test/stubs.c +++ b/core/test/stubs.c @@ -17,7 +17,9 @@ #include <stdio.h> #include <stdarg.h> -void prlog(int log_level __attribute__((unused)), char *fmt, ...) +void prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3))); + +void prlog(int log_level __attribute__((unused)), const char* fmt, ...) { va_list ap; diff --git a/hdata/memory.c b/hdata/memory.c index d6e87cb..cf336a0 100644 --- a/hdata/memory.c +++ b/hdata/memory.c @@ -116,9 +116,11 @@ static bool add_address_range(struct dt_node *root, { struct dt_node *mem; u64 reg[2]; - char name[sizeof("memory@") + STR_MAX_CHARS(reg[0])]; + char *name; u32 chip_id; + name = (char*)malloc(sizeof("memory@") + STR_MAX_CHARS(reg[0])); + prlog(PR_DEBUG, " Range: 0x%016llx..0x%016llx " "on Chip 0x%x mattr: 0x%x\n", (long long)arange->start, (long long)arange->end, @@ -149,6 +151,8 @@ static bool add_address_range(struct dt_node *root, dt_add_property_cells(mem, DT_PRIVATE "share-id", be16_to_cpu(id->share_id)); + free(name); + return true; } diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c index dd71667..c7dae5f 100644 --- a/hdata/test/stubs.c +++ b/hdata/test/stubs.c @@ -17,7 +17,9 @@ #include <stdio.h> #include <stdarg.h> -void prlog(int log_level __attribute__((unused)), char *fmt, ...) +void prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3))); + +void prlog(int log_level __attribute__((unused)), const char* fmt, ...) { va_list ap; @@ -524,13 +524,13 @@ static void occ_tmgt_interrupt(void) printf("OCC: TMGT interrupt !\n"); } -void occ_interrupt(void) +void occ_interrupt(uint32_t chip_id) { uint64_t ireg; int64_t rc; /* The OCC interrupt is used to mux up to 15 different sources */ - rc = xscom_readme(OCB_OCI_OCCMISC, &ireg); + rc = xscom_read(chip_id, OCB_OCI_OCCMISC, &ireg); if (rc) { prerror("OCC: Failed to read interrupt status !\n"); /* Should we mask it in the XIVR ? */ @@ -539,7 +539,7 @@ void occ_interrupt(void) prlog(PR_TRACE, "OCC: IRQ received: %04llx\n", ireg >> 48); /* Clear the bits */ - xscom_writeme(OCB_OCI_OCCMISC_AND, ~ireg); + xscom_write(chip_id, OCB_OCI_OCCMISC_AND, ~ireg); /* Dispatch */ if (ireg & OCB_OCI_OCIMISC_IRQ_TMGT) @@ -278,7 +278,7 @@ static void handle_extra_interrupt(struct psi *psi) * when available. */ if (val & PSIHB_IRQ_STAT_OCC) - occ_interrupt(); + occ_interrupt(psi->chip_id); if (val & PSIHB_IRQ_STAT_FSI) printf("PSI: FSI irq received\n"); if (val & PSIHB_IRQ_STAT_LPC) { diff --git a/include/skiboot.h b/include/skiboot.h index 0991ca3..1b55638 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -210,7 +210,7 @@ extern void uart_setup_linux_passthrough(void); extern void uart_setup_opal_console(void); /* OCC interrupt */ -extern void occ_interrupt(void); +extern void occ_interrupt(uint32_t chip_id); extern void occ_send_dummy_interrupt(void); /* Flatten device-tree */ |