Browse Source

[bsp][x86] strict coding standards

JasonHu 3 years ago
parent
commit
19a454d097
2 changed files with 3 additions and 2 deletions
  1. 2 1
      bsp/x86/drivers/drv_ahci.c
  2. 1 1
      components/lwp/arch/x86/i386/lwp_arch.c

+ 2 - 1
bsp/x86/drivers/drv_ahci.c

@@ -70,8 +70,9 @@ static rt_uint32_t ahci_flush_commands(struct hba_port *port)
     /* the commands may not take effect until the command
     /* the commands may not take effect until the command
      * register is read again by software, because reasons.
      * register is read again by software, because reasons.
      */
      */
+    rt_hw_dsb();
     volatile rt_uint32_t c = port->command;
     volatile rt_uint32_t c = port->command;
-    c = c;
+    rt_hw_dmb();
     return c;
     return c;
 }
 }
 
 

+ 1 - 1
components/lwp/arch/x86/i386/lwp_arch.c

@@ -189,7 +189,7 @@ void lwp_user_thread_entry(void *args, const void *text, void *ustack, void *k_s
     RT_ASSERT(ustack != NULL);
     RT_ASSERT(ustack != NULL);
 
 
     rt_uint8_t *stk;
     rt_uint8_t *stk;
-    stk  = k_stack + sizeof(rt_ubase_t);
+    stk  = (rt_uint8_t *)((rt_uint8_t *)k_stack + sizeof(rt_ubase_t));
     stk  = (rt_uint8_t *)RT_ALIGN_DOWN(((rt_ubase_t)stk), sizeof(rt_ubase_t));
     stk  = (rt_uint8_t *)RT_ALIGN_DOWN(((rt_ubase_t)stk), sizeof(rt_ubase_t));
     stk -= sizeof(struct rt_hw_stack_frame);
     stk -= sizeof(struct rt_hw_stack_frame);
     struct rt_hw_stack_frame *frame = (struct rt_hw_stack_frame *)stk;
     struct rt_hw_stack_frame *frame = (struct rt_hw_stack_frame *)stk;