init: use SYS_INIT() where it makes sense
Mostly SoC initialization and some kernel subsystems, but also some device drivers like the interrupt controllers. Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
629e1dd861
commit
a4ec963138
21 changed files with 26 additions and 69 deletions
|
@ -48,6 +48,5 @@ static int quark_se_arc_init(struct device *arg)
|
||||||
shared_data->flags |= ARC_READY;
|
shared_data->flags |= ARC_READY;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DEVICE_INIT(quark_se_arc_0, "", quark_se_arc_init,
|
|
||||||
NULL, NULL,
|
SYS_INIT(quark_se_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -71,8 +71,6 @@ static int uart_ns16550_init(struct device *dev)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(uart_ns16550_init, "", uart_ns16550_init,
|
SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif /* CONFIG_UART_NS16550 */
|
#endif /* CONFIG_UART_NS16550 */
|
||||||
|
|
|
@ -194,6 +194,4 @@ static int atmel_sam3_init(struct device *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(atmel_sam3_0, "", atmel_sam3_init,
|
DEVICE_INIT(atmel_sam3_init, PRIMARY, 0);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, 0);
|
|
||||||
|
|
|
@ -320,6 +320,4 @@ static int fsl_frdm_k64f_init(struct device *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(fsl_frdm_0, "", fsl_frdm_k64f_init,
|
SYS_INIT(fsl_frdm_k64f_init, PRIMARY, 0);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, 0);
|
|
||||||
|
|
|
@ -71,9 +71,7 @@ static int uart_k20_console_init(struct device *dev)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(_uart_k20_console, "", uart_k20_console_init,
|
SYS_INIT(uart_k20_console_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_UART_CONSOLE */
|
#endif /* CONFIG_UART_CONSOLE */
|
||||||
|
|
|
@ -56,6 +56,4 @@ static int ti_lm3s6965_init(struct device *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(ti_lm3_0, "", ti_lm3s6965_init,
|
SYS_INIT(ti_lm3s6965_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -51,8 +51,6 @@ static int uart_stellaris_init(struct device *dev)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(_uart_stellaris_en, "", uart_stellaris_init,
|
SYS_INIT(uart_stellaris_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
|
||||||
|
|
||||||
#endif /* CONFIG_UART_STELLARIS */
|
#endif /* CONFIG_UART_STELLARIS */
|
||||||
|
|
|
@ -107,8 +107,6 @@ static int init_cache(struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(cache, "", init_cache,
|
SYS_INIT(init_cache, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif /* CONFIG_CLFLUSH_DETECT || CONFIG_CACHE_LINE_SIZE_DETECT */
|
#endif /* CONFIG_CLFLUSH_DETECT || CONFIG_CACHE_LINE_SIZE_DETECT */
|
||||||
|
|
|
@ -62,12 +62,8 @@ static int quark_d2000_init(struct device *arg)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DEVICE_INIT(quark_d2000_0, "", quark_d2000_init,
|
SYS_INIT(quark_d2000_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#ifdef CONFIG_MVIC
|
#ifdef CONFIG_MVIC
|
||||||
DEVICE_INIT(mvic_0, "", _mvic_init,
|
SYS_INIT(_mvic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
#endif /* CONFIG_IOAPIC */
|
#endif /* CONFIG_IOAPIC */
|
||||||
|
|
|
@ -86,9 +86,7 @@ static int arc_init(struct device *arg)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(quark_se_ss_0, "", arc_init,
|
SYS_INIT(arc_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif /*CONFIG_ARC_INIT*/
|
#endif /*CONFIG_ARC_INIT*/
|
||||||
|
|
||||||
|
@ -110,9 +108,7 @@ static int platform_uart_init(struct device *arg)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(platform_uart_init, "", platform_uart_init,
|
SYS_INIT(platform_uart_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
||||||
#endif /* CONFIG_UART_NS16550 */
|
#endif /* CONFIG_UART_NS16550 */
|
||||||
|
|
|
@ -67,7 +67,6 @@ static int pci_legacy_bridge_irq_config(struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(pci_legacy_bridge_0, "", pci_legacy_bridge_irq_config,
|
SYS_INIT(pci_legacy_bridge_irq_config,
|
||||||
NULL, NULL,
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
|
||||||
#endif /* CONFIG_PCI_LEGACY_BRIDGE */
|
#endif /* CONFIG_PCI_LEGACY_BRIDGE */
|
||||||
|
|
|
@ -259,6 +259,4 @@ static int _bt_uart_init(struct device *unused)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(bt_uart, "", _bt_uart_init,
|
SYS_INIT(_bt_uart_init, NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
NULL, NULL,
|
|
||||||
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
|
||||||
|
|
|
@ -790,6 +790,4 @@ static int _bt_uart_init(struct device *unused)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(bt_uart, "", _bt_uart_init,
|
SYS_INIT(_bt_uart_init, NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
NULL, NULL,
|
|
||||||
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
|
||||||
|
|
|
@ -45,7 +45,4 @@ static int ram_console_init(struct device *d)
|
||||||
return DEV_OK;
|
return DEV_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(ram_console, "", ram_console_init,
|
SYS_INIT(ram_console_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
|
|
|
@ -431,8 +431,7 @@ static int uart_console_init(struct device *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UART consloe initializes after the UART device itself */
|
/* UART consloe initializes after the UART device itself */
|
||||||
DEVICE_INIT(uart_console, "", uart_console_init,
|
SYS_INIT(uart_console_init,
|
||||||
NULL, NULL,
|
|
||||||
#if defined(CONFIG_EARLY_CONSOLE)
|
#if defined(CONFIG_EARLY_CONSOLE)
|
||||||
PRIMARY,
|
PRIMARY,
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -62,6 +62,4 @@ int _i8259_init(struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(pic_0, "", _i8259_init,
|
SYS_INIT(_i8259_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -314,6 +314,4 @@ static void _IoApicRedUpdateLo(unsigned int irq,
|
||||||
ioApicRedSetLo(irq, (ioApicRedGetLo(irq) & ~mask) | (value & mask));
|
ioApicRedSetLo(irq, (ioApicRedGetLo(irq) & ~mask) | (value & mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(ioapic_0, "", _ioapic_init,
|
SYS_INIT(_ioapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -444,9 +444,7 @@ int _loapic_isr_vector_get(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(loapic_0, "", _loapic_init,
|
SYS_INIT(_loapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
|
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
|
||||||
extern void _loapic_spurious_handler(void);
|
extern void _loapic_spurious_handler(void);
|
||||||
|
|
|
@ -32,6 +32,4 @@
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <drivers/system_timer.h>
|
#include <drivers/system_timer.h>
|
||||||
|
|
||||||
DEVICE_INIT(sys_clock, "sys_clock", _sys_clock_driver_init,
|
SYS_INIT(_sys_clock_driver_init, NANOKERNEL, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
|
||||||
NULL, NULL,
|
|
||||||
NANOKERNEL, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
|
|
||||||
|
|
|
@ -53,9 +53,8 @@ static int _sys_k_event_logger_init(struct device *arg)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DEVICE_INIT(kernel_event_logger_0, "", _sys_k_event_logger_init,
|
SYS_INIT(_sys_k_event_logger_init,
|
||||||
NULL, NULL,
|
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
|
|
||||||
void sys_k_event_logger_put_timed(uint16_t event_id)
|
void sys_k_event_logger_put_timed(uint16_t event_id)
|
||||||
|
|
|
@ -290,6 +290,4 @@ static int init(struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(mem_safe, "", init,
|
SYS_INIT(init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
NULL, NULL,
|
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue