aboutsummaryrefslogtreecommitdiff
path: root/product/rdn2/scp_ramfw/rtx_config.c
blob: ce88d98f8d71705303de69d2aed557b6375d4ce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Arm SCP/MCP Software
 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "clock_soc.h"

#include <rtx_lib.c>
#include <rtx_os.h>

#include <fwk_mm.h>

#include <fmw_cmsis.h>

#include <stdbool.h>
#include <stdint.h>

/*
 * Required by RTX to configure the SysTick timer.
 */
uint32_t SystemCoreClock = CLOCK_RATE_REFCLK;

/*
 * Idle thread
 */
__NO_RETURN void osRtxIdleThread(void *argument)
{
    while (true)
        __WFI();
}

/*
 * OS error handler
 */
uint32_t osRtxErrorNotify(uint32_t code, void *object_id)
{
    osRtxIdleThread(object_id);
}

uint32_t osRtxMemoryInit(void *mem, uint32_t size)
{
    return 1;
}

void *osRtxMemoryAlloc(void *mem, uint32_t size, uint32_t type)
{
    return fwk_mm_alloc(1, size);
}

uint32_t osRtxMemoryFree(void *mem, void *block)
{
    fwk_mm_free(block);

    return 1;
}