From 3e0eef2e9a922acb853f38c7fe42198bf7fb177d Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Fri, 29 Mar 2019 11:58:49 +1100 Subject: Force noinline for pci_add_(one_)device_node(s)() We call all of these things recursively, so don't use excess stack. Signed-off-by: Stewart Smith --- core/pci.c | 20 ++++++++++---------- include/compiler.h | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/pci.c b/core/pci.c index 7dbe6aac..57154b07 100644 --- a/core/pci.c +++ b/core/pci.c @@ -1524,11 +1524,11 @@ static void pci_print_summary_line(struct phb *phb, struct pci_device *pd, rev_class & 0xff, rev_class >> 8, cname, slotstr); } -static void pci_add_one_device_node(struct phb *phb, - struct pci_device *pd, - struct dt_node *parent_node, - struct pci_lsi_state *lstate, - uint8_t swizzle) +static void __noinline pci_add_one_device_node(struct phb *phb, + struct pci_device *pd, + struct dt_node *parent_node, + struct pci_lsi_state *lstate, + uint8_t swizzle) { struct dt_node *np; const char *cname; @@ -1653,11 +1653,11 @@ static void pci_add_one_device_node(struct phb *phb, dt_add_property(np, "ranges", ranges_direct, sizeof(ranges_direct)); } -void pci_add_device_nodes(struct phb *phb, - struct list_head *list, - struct dt_node *parent_node, - struct pci_lsi_state *lstate, - uint8_t swizzle) +void __noinline pci_add_device_nodes(struct phb *phb, + struct list_head *list, + struct dt_node *parent_node, + struct pci_lsi_state *lstate, + uint8_t swizzle) { struct pci_device *pd; diff --git a/include/compiler.h b/include/compiler.h index 35bf1652..9a4602e7 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -31,6 +31,7 @@ /* not __const as this has a different meaning (const) */ #define __attrconst __attribute__((const)) #define __warn_unused_result __attribute__((warn_unused_result)) +#define __noinline __attribute__((noinline)) #if 0 /* Provided by gcc stddef.h */ #define offsetof(type,m) __builtin_offsetof(type,m) -- cgit v1.2.1