update openharmony 1.0.1

This commit is contained in:
mamingshuai
2021-03-11 18:43:57 +08:00
parent e351799d39
commit 73a7b66116
611 changed files with 17977 additions and 14077 deletions

4
platform/hw/arm/interrupt/gic/gic_v2.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:

4
platform/hw/arm/interrupt/gic/gic_v3.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:

33
platform/hw/arm/timer/arm_generic/arm_generic_timer.c Normal file → Executable file
View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -31,6 +31,7 @@
#include "los_hw_pri.h"
#include "los_tick_pri.h"
#include "los_sched_pri.h"
#include "los_sys_pri.h"
#include "gic_common.h"
@@ -87,8 +88,6 @@
#endif
#define OS_CYCLE_PER_TICK (g_sysClock / LOSCFG_BASE_CORE_TICK_PER_SECOND)
UINT32 HalClockFreqRead(VOID)
{
return READ_TIMER_REG32(TIMER_REG_CNTFRQ);
@@ -127,27 +126,12 @@ UINT64 HalClockGetCycles(VOID)
return cntpct;
}
LITE_OS_SEC_TEXT VOID OsTickEntry(VOID)
{
TimerCtlWrite(0);
OsTickHandler();
/*
* use last cval to generate the next tick's timing is
* absolute and accurate. DO NOT use tval to drive the
* generic time in which case tick will be slower.
*/
TimerCvalWrite(TimerCvalRead() + OS_CYCLE_PER_TICK);
TimerCtlWrite(1);
}
LITE_OS_SEC_TEXT_INIT VOID HalClockInit(VOID)
{
UINT32 ret;
g_sysClock = HalClockFreqRead();
ret = LOS_HwiCreate(OS_TICK_INT_NUM, MIN_INTERRUPT_PRIORITY, 0, OsTickEntry, 0);
ret = LOS_HwiCreate(OS_TICK_INT_NUM, MIN_INTERRUPT_PRIORITY, 0, OsTickHandler, 0);
if (ret != LOS_OK) {
PRINT_ERR("%s, %d create tick irq failed, ret:0x%x\n", __FUNCTION__, __LINE__, ret);
}
@@ -155,6 +139,11 @@ LITE_OS_SEC_TEXT_INIT VOID HalClockInit(VOID)
LITE_OS_SEC_TEXT_INIT VOID HalClockStart(VOID)
{
UINT32 ret = OsSchedSetTickTimerType(64); /* 64 bit tick timer */
if (ret != LOS_OK) {
return;
}
HalIrqUnmask(OS_TICK_INT_NUM);
/* triggle the first tick */
@@ -165,7 +154,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalClockStart(VOID)
VOID HalDelayUs(UINT32 usecs)
{
UINT64 cycles = (UINT64)usecs * HalClockFreqRead() / OS_SYS_US_PER_SECOND;
UINT64 cycles = (UINT64)usecs * g_sysClock / OS_SYS_US_PER_SECOND;
UINT64 deadline = HalClockGetCycles() + cycles;
while (HalClockGetCycles() < deadline) {
@@ -186,7 +175,7 @@ UINT32 HalClockGetTickTimerCycles(VOID)
return (UINT32)((cval > cycles) ? (cval - cycles) : 0);
}
VOID HalClockTickTimerReload(UINT32 cycles)
VOID HalClockTickTimerReload(UINT64 cycles)
{
HalIrqMask(OS_TICK_INT_NUM);
HalIrqClear(OS_TICK_INT_NUM);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -31,6 +31,7 @@
#include "asm/platform.h"
#include "los_hwi.h"
#include "los_sched_pri.h"
#include "los_tick_pri.h"
#define OS_CYCLE_PER_TICK (TIMER_FREQ / LOSCFG_BASE_CORE_TICK_PER_SECOND)
@@ -67,6 +68,11 @@ VOID HalClockFreqWrite(UINT32 freq)
VOID HalClockStart(VOID)
{
UINT32 ret = OsSchedSetTickTimerType(32); /* 32 bit tick timer */
if (ret != LOS_OK) {
return;
}
HalIrqUnmask(PRVTIMER_INT_NUM);
g_privateTimer->load = OS_CYCLE_PER_TICK;
@@ -124,12 +130,12 @@ UINT32 HalClockGetTickTimerCycles(VOID)
return g_privateTimer->count;
}
VOID HalClockTickTimerReload(UINT32 period)
VOID HalClockTickTimerReload(UINT64 period)
{
HalIrqUnmask(PRVTIMER_INT_NUM);
/* set control counter regs to defaults */
g_privateTimer->load = period;
g_privateTimer->load = (UINT32)period;
g_privateTimer->control = 0x06; /* IAE bits = 110, not eanbled yet */
g_privateTimer->control |= 0x01; /* reenable private timer */
}