forked from xuos/xiuos
use common spinlock.c
This commit is contained in:
parent
8f3df1e5c2
commit
f5ad8437b5
|
@ -34,13 +34,30 @@ Modification:
|
||||||
|
|
||||||
#include "clock_common_op.h"
|
#include "clock_common_op.h"
|
||||||
#include "irq_numbers.h"
|
#include "irq_numbers.h"
|
||||||
|
#include "multicores.h"
|
||||||
|
|
||||||
static void _sys_clock_init()
|
static void _sys_clock_init()
|
||||||
{
|
{
|
||||||
uint32_t freq = get_main_clock(IPG_CLK);
|
uint32_t freq = get_main_clock(IPG_CLK);
|
||||||
gpt_init(CLKSRC_IPG_CLK, freq / 1000000, RESTART_MODE, WAIT_MODE_EN | STOP_MODE_EN);
|
gpt_init(CLKSRC_IPG_CLK, freq / 1000000, RESTART_MODE, WAIT_MODE_EN | STOP_MODE_EN);
|
||||||
gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000);
|
switch (cur_cpuid()) {
|
||||||
gpt_counter_enable(kGPTOutputCompare1);
|
case 0:
|
||||||
|
gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000);
|
||||||
|
gpt_counter_enable(kGPTOutputCompare1);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
gpt_set_compare_event(kGPTOutputCompare2, OUTPUT_CMP_DISABLE, 1000);
|
||||||
|
gpt_counter_enable(kGPTOutputCompare2);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
gpt_set_compare_event(kGPTOutputCompare3, OUTPUT_CMP_DISABLE, 1000);
|
||||||
|
gpt_counter_enable(kGPTOutputCompare3);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000);
|
||||||
|
gpt_counter_enable(kGPTOutputCompare1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t _get_clock_int()
|
static uint32_t _get_clock_int()
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
SRC_DIR := arm/armv7-a/cortex-a9
|
SRC_DIR := arm/armv7-a/cortex-a9
|
||||||
|
SRC_FILES := spinlock.c
|
||||||
|
|
||||||
include $(KERNEL_ROOT)/compiler.mk
|
include $(KERNEL_ROOT)/compiler.mk
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
SRC_FILES := vector.S trampoline.S $(BOARD)/trap_common.c error_debug.c spinlock.c hard_spinlock.S
|
SRC_FILES := vector.S trampoline.S $(BOARD)/trap_common.c error_debug.c hard_spinlock.S
|
||||||
|
|
||||||
ifeq ($(BOARD), imx6q-sabrelite)
|
ifeq ($(BOARD), imx6q-sabrelite)
|
||||||
SRC_DIR := gicv2
|
SRC_DIR := gicv2
|
||||||
|
@ -9,7 +9,6 @@ ifeq ($(BOARD), zynq7000-zc702)
|
||||||
# SRC_DIR := gicv2
|
# SRC_DIR := gicv2
|
||||||
SRC_DIR := gicv3
|
SRC_DIR := gicv3
|
||||||
SRC_FILES += $(BOARD)/xil_assert.c
|
SRC_FILES += $(BOARD)/xil_assert.c
|
||||||
# SRC_FILES := vector.S trampoline.S imx6q-sabrelite/trap_common.c error_debug.c spinlock.c hard_spinlock.S
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,12 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "assert.h"
|
|
||||||
#include "multicores.h"
|
|
||||||
#include "spinlock.h"
|
#include "spinlock.h"
|
||||||
#include "task.h"
|
|
||||||
#include "trap_common.h"
|
#include "trap_common.h"
|
||||||
|
|
||||||
|
#include "assert.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
#include "multicores.h"
|
||||||
|
|
||||||
struct lock_node {
|
struct lock_node {
|
||||||
int cpu_id;
|
int cpu_id;
|
Loading…
Reference in New Issue