arch: or1k: nxstyle fixes

Nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2021-03-30 13:21:20 +02:00 committed by David Sidrane
parent fd512dcc4b
commit 7e2ee8b9bb
8 changed files with 35 additions and 24 deletions

View File

@ -215,6 +215,7 @@ static inline irqstate_t up_irq_save(void)
mfspr(SPR_SYS_SR, flags); mfspr(SPR_SYS_SR, flags);
/* Disable IRQs */ /* Disable IRQs */
x = flags & ~(SPR_SR_IEE | SPR_SR_TEE); x = flags & ~(SPR_SR_IEE | SPR_SR_TEE);
mtspr(SPR_SYS_SR, x); mtspr(SPR_SYS_SR, x);

View File

@ -43,6 +43,7 @@
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/ /* Configuration ************************************************************/
/* Terminology. In the flat build (CONFIG_BUILD_FLAT=y), there is only a /* Terminology. In the flat build (CONFIG_BUILD_FLAT=y), there is only a
* single heap access with the standard allocations (malloc/free). This * single heap access with the standard allocations (malloc/free). This
* heap is referred to as the user heap. In the protected build * heap is referred to as the user heap. In the protected build
@ -86,7 +87,8 @@
* *
* Kernel .data region. Size determined at link time. * Kernel .data region. Size determined at link time.
* Kernel .bss region Size determined at link time. * Kernel .bss region Size determined at link time.
* Kernel IDLE thread stack. Size determined by CONFIG_IDLETHREAD_STACKSIZE. * Kernel IDLE thread stack. Size determined by
* CONFIG_IDLETHREAD_STACKSIZE.
* Padding for alignment * Padding for alignment
* User .data region. Size determined at link time. * User .data region. Size determined at link time.
* User .bss region Size determined at link time. * User .bss region Size determined at link time.
@ -107,7 +109,8 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
* of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment). * of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment).
*/ */
uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend + CONFIG_MM_KERNEL_HEAPSIZE; uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
CONFIG_MM_KERNEL_HEAPSIZE;
size_t usize = CONFIG_RAM_END - ubase; size_t usize = CONFIG_RAM_END - ubase;
DEBUGASSERT(ubase < (uintptr_t)CONFIG_RAM_END); DEBUGASSERT(ubase < (uintptr_t)CONFIG_RAM_END);
@ -147,7 +150,8 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
* of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment). * of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment).
*/ */
uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend + CONFIG_MM_KERNEL_HEAPSIZE; uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
CONFIG_MM_KERNEL_HEAPSIZE;
DEBUGASSERT(ubase < (uintptr_t)CONFIG_RAM_END); DEBUGASSERT(ubase < (uintptr_t)CONFIG_RAM_END);
/* Return the kernel heap settings (i.e., the part of the heap region /* Return the kernel heap settings (i.e., the part of the heap region

View File

@ -68,8 +68,10 @@ int or1k_print_cpuinfo(void)
if ((vr & SPR_VR_UVRP) != 0) if ((vr & SPR_VR_UVRP) != 0)
{ {
mfspr(SPR_SYS_VR2, vr2); mfspr(SPR_SYS_VR2, vr2);
syslog(LOG_INFO, " CPUID: %d\n", (vr2 & SPR_VR2_CPUID_MASK) >> SPR_VR2_CPUID_SHIFT); syslog(LOG_INFO, " CPUID: %d\n",
syslog(LOG_INFO, " V2.VER: 0x%x\n", (vr2 & SPR_VR2_VER_MASK) >> SPR_VR2_VER_SHIFT); (vr2 & SPR_VR2_CPUID_MASK) >> SPR_VR2_CPUID_SHIFT);
syslog(LOG_INFO, " V2.VER: 0x%x\n",
(vr2 & SPR_VR2_VER_MASK) >> SPR_VR2_VER_SHIFT);
} }
syslog(LOG_INFO, " AVR/VR2: %s\n", syslog(LOG_INFO, " AVR/VR2: %s\n",

View File

@ -148,14 +148,14 @@ EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
EXTERN uint32_t g_intstackbase; /* Initial top of interrupt stack */ EXTERN uint32_t g_intstackbase; /* Initial top of interrupt stack */
#endif #endif
/* These 'addresses' of these values are setup by the linker script. They are /* These 'addresses' of these values are setup by the linker script. They
* not actual uint32_t storage locations! They are only used meaningfully in the * are not actual uint32_t storage locations! They are only used meaningfully
* following way: * in the following way:
* *
* - The linker script defines, for example, the symbol_sdata. * - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32_t _sdata; makes C happy. C will believe * - The declareion extern uint32_t _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32_t variable _data (it is * that the value _sdata is the address of a uint32_t variable _data
* not!). * (it is not!).
* - We can recoved the linker value then by simply taking the address of * - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32_t *pdata = &_sdata; * of _data. like: uint32_t *pdata = &_sdata;
*/ */
@ -168,9 +168,9 @@ EXTERN uint32_t _edata; /* End+1 of .data */
EXTERN uint32_t _sbss; /* Start of .bss */ EXTERN uint32_t _sbss; /* Start of .bss */
EXTERN uint32_t _ebss; /* End+1 of .bss */ EXTERN uint32_t _ebss; /* End+1 of .bss */
/* Sometimes, functions must be executed from RAM. In this case, the following /* Sometimes, functions must be executed from RAM. In this case, the
* macro may be used (with GCC!) to specify a function that will execute from * following macro may be used (with GCC!) to specify a function that will
* RAM. For example, * execute from RAM. For example,
* *
* int __ramfunc__ foo (void); * int __ramfunc__ foo (void);
* int __ramfunc__ foo (void) { return bar; } * int __ramfunc__ foo (void) { return bar; }
@ -210,12 +210,12 @@ EXTERN uint32_t _eramfuncs; /* Copy destination end address in RAM */
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* Low level initialization provided by board-level logic ******************/ /* Low level initialization provided by board-level logic *******************/
void or1k_boot(void); void or1k_boot(void);
int or1k_print_cpuinfo(void); int or1k_print_cpuinfo(void);
@ -308,10 +308,10 @@ void up_wdtinit(void);
/* Networking ***************************************************************/ /* Networking ***************************************************************/
/* Defined in board/xyz_network.c for board-specific Ethernet implementations, /* Defined in board/xyz_network.c for board-specific Ethernet
* or chip/xyx_ethernet.c for chip-specific Ethernet implementations, or * implementations, or chip/xyx_ethernet.c for chip-specific Ethernet
* common/up_etherstub.c for a corner case where the network is enabled yet * implementations, or common/up_etherstub.c for a corner case where the
* there is no Ethernet driver to be initialized. * network is enabled yet there is no Ethernet driver to be initialized.
* *
* Use of common/up_etherstub.c is deprecated. The preferred mechanism is to * Use of common/up_etherstub.c is deprecated. The preferred mechanism is to
* use CONFIG_NETDEV_LATEINIT=y to suppress the call to up_netinitialize() in * use CONFIG_NETDEV_LATEINIT=y to suppress the call to up_netinitialize() in

View File

@ -73,7 +73,9 @@
static int or1k_timer_isr(int irq, uint32_t *regs, void *arg) static int or1k_timer_isr(int irq, uint32_t *regs, void *arg)
{ {
uint32_t ttmr = TTMR_LOAD; uint32_t ttmr = TTMR_LOAD;
/* Clear the TTMR interrupt */ /* Clear the TTMR interrupt */
mtspr(SPR_TICK_TTMR, ttmr); mtspr(SPR_TICK_TTMR, ttmr);
nxsched_process_timer(); nxsched_process_timer();

View File

@ -88,7 +88,7 @@ void up_earlyserialinit(void)
#ifdef HAVE_SERIAL_CONSOLE #ifdef HAVE_SERIAL_CONSOLE
/* Mark the serial console (if any) */ /* Mark the serial console (if any) */
//CONSOLE_DEV.isconsole = true; /* CONSOLE_DEV.isconsole = true; */
#endif #endif
} }
#endif #endif
@ -139,10 +139,11 @@ int up_putc(int ch)
{ {
/* Add CR */ /* Add CR */
//or1k_lowputc('\r'); /* or1k_lowputc('\r'); */
} }
//or1k_lowputc(ch); /* or1k_lowputc(ch); */
leave_critical_section(flags); leave_critical_section(flags);
#endif #endif
return ch; return ch;

View File

@ -28,7 +28,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************

View File

@ -145,7 +145,8 @@ void up_ack_irq(int irq)
{ {
if (irq <= 31) if (irq <= 31)
{ {
//uint32_t sr = (1 << irq); /* uint32_t sr = (1 << irq); */
uint32_t sr = 0; uint32_t sr = 0;
mtspr(SPR_PIC_SR, sr); mtspr(SPR_PIC_SR, sr);
} }