los_context.h 3.6 KB
Newer Older
W
wenjun 已提交
1
/*
M
mamingshuai 已提交
2 3
 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
W
wenjun 已提交
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
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 *    conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 *    of conditions and the following disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
 *    to endorse or promote products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
33
 * @defgroup los_context hardware
W
wenjun 已提交
34 35 36
 * @ingroup kernel
 */

37 38
#ifndef _LOS_CONTEXT_H
#define _LOS_CONTEXT_H
W
wenjun 已提交
39

C
Caoruihong 已提交
40
#include "los_compiler.h"
41
#include "los_interrupt.h"
C
Caoruihong 已提交
42

W
wenjun 已提交
43 44 45 46 47 48
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */

49 50
/**
 * @ingroup  los_context
W
wenjun 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64
 * @brief: Task stack initialization.
 *
 * @par Description:
 * This API is used to initialize the task stack.
 *
 * @attention:
 * <ul><li>None.</li></ul>
 *
 * @param  taskID     [IN] Type#UINT32: TaskID.
 * @param  stackSize  [IN] Type#UINT32: Total size of the stack.
 * @param  topStack   [IN] Type#VOID *: Top of task's stack.
 *
 * @retval: context Type#TaskContext *.
 * @par Dependency:
65
 * <ul><li>los_context.h: the header file that contains the API declaration.</li></ul>
W
wenjun 已提交
66 67
 * @see None.
 */
L
LiteOS2021 已提交
68
VOID *ArchTskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack);
69

W
wenjun 已提交
70
/**
71
 * @ingroup  los_context
C
Caoruihong 已提交
72
 * @brief: Function to sys exit.
W
wenjun 已提交
73 74
 *
 * @par Description:
C
Caoruihong 已提交
75
 * This API is used to sys exit.
W
wenjun 已提交
76 77 78 79 80 81 82 83
 *
 * @attention:
 * <ul><li>None.</li></ul>
 *
 * @param  None.
 *
 * @retval: None.
 * @par Dependency:
84
 * <ul><li>los_context.h: the header file that contains the API declaration.</li></ul>
W
wenjun 已提交
85 86
 * @see None.
 */
L
LiteOS2021 已提交
87
LITE_OS_SEC_TEXT_MINOR NORETURN VOID ArchSysExit(VOID);
W
wenjun 已提交
88

89
/**
C
Caoruihong 已提交
90 91
 * @ingroup  los_context
 * @brief: Task scheduling Function.
W
wenjun 已提交
92 93
 *
 * @par Description:
C
Caoruihong 已提交
94
 * This API is used to scheduling task.
W
wenjun 已提交
95 96 97 98 99 100 101 102
 *
 * @attention:
 * <ul><li>None.</li></ul>
 *
 * @param  None.
 *
 * @retval: None.
 * @par Dependency:
C
Caoruihong 已提交
103
 * <ul><li>los_context.h: the header file that contains the API declaration.</li></ul>
W
wenjun 已提交
104 105
 * @see None.
 */
L
LiteOS2021 已提交
106
VOID ArchTaskSchedule(VOID);
C
Caoruihong 已提交
107

L
LiteOS2021 已提交
108
UINT32 ArchStartSchedule(VOID);
109
VOID *ArchSignalContextInit(VOID *stackPointer, VOID *stackTop, UINTPTR sigHandler, UINT32 param);
C
Caoruihong 已提交
110

W
wenjun 已提交
111 112 113 114 115 116
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */

117
#endif /* _LOS_CONTEXT_H */