File tree Expand file tree Collapse file tree 10 files changed +50
-20
lines changed
ARMv8M/non_secure/portable Expand file tree Collapse file tree 10 files changed +50
-20
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and/or its affiliates
5
+ * <open-source-office@arm.com>
4
6
*
5
7
* SPDX-License-Identifier: MIT
6
8
*
130
132
" \n"
131
133
" ldm r0!, {r1-r2} \n" /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
132
134
" msr psplim, r1 \n" /* Set this task's PSPLIM value. */
133
- " movs r1, #2 \n" /* r1 = 2. */
134
- " msr CONTROL, r1 \n" /* Switch to use PSP in the thread mode. */
135
+ " mrs r3, control \n" /* Obtain current control register value. */
136
+ " orrs r3, r3, #2 \n" /* r3 = r3 | 0x2. */
137
+ " msr control, r3 \n" /* Write back the new control register value. */
135
138
" adds r0, #32 \n" /* Discard everything up to r0. */
136
139
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
137
140
" isb \n"
Original file line number Diff line number Diff line change 1
1
/ *
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com , Inc . or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and / or its affiliates
5
+ * <open - source - office@arm.com>
4
6
*
5
7
* SPDX - License - Identifier: MIT
6
8
*
@@ -165,8 +167,9 @@ vRestoreContextOfFirstTask:
165
167
166
168
ldm r0! , {r1 - r2} / * Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. * /
167
169
msr psplim , r1 / * Set this task's PSPLIM value. * /
168
- movs r1 , # 2 / * r1 = 2 . * /
169
- msr CONTROL , r1 / * Switch to use PSP in the thread mode. * /
170
+ mrs r3 , control / * Obtain current control register value. * /
171
+ orrs r3 , r3 , # 2 / * r3 = r3 | 0x2 * /
172
+ msr control , r3 / * Write back the new control register value. * /
170
173
adds r0 , # 32 / * Discard everything up to r0. * /
171
174
msr psp , r0 / * This is now the new top of stack to use in the task. * /
172
175
isb
Original file line number Diff line number Diff line change 1
1
/*
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and/or its affiliates
5
+ * <open-source-office@arm.com>
4
6
*
5
7
* SPDX-License-Identifier: MIT
6
8
*
130
132
" \n"
131
133
" ldm r0!, {r1-r2} \n" /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
132
134
" msr psplim, r1 \n" /* Set this task's PSPLIM value. */
133
- " movs r1, #2 \n" /* r1 = 2. */
134
- " msr CONTROL, r1 \n" /* Switch to use PSP in the thread mode. */
135
+ " mrs r3, control \n" /* Obtain current control register value. */
136
+ " orrs r3, r3, #2 \n" /* r3 = r3 | 0x2. */
137
+ " msr control, r3 \n" /* Write back the new control register value. */
135
138
" adds r0, #32 \n" /* Discard everything up to r0. */
136
139
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
137
140
" isb \n"
Original file line number Diff line number Diff line change 1
1
/*
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and/or its affiliates
5
+ * <open-source-office@arm.com>
4
6
*
5
7
* SPDX-License-Identifier: MIT
6
8
*
130
132
" \n"
131
133
" ldm r0!, {r1-r2} \n" /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
132
134
" msr psplim, r1 \n" /* Set this task's PSPLIM value. */
133
- " movs r1, #2 \n" /* r1 = 2. */
134
- " msr CONTROL, r1 \n" /* Switch to use PSP in the thread mode. */
135
+ " mrs r3, control \n" /* Obtain current control register value. */
136
+ " orrs r3, r3, #2 \n" /* r3 = r3 | 0x2. */
137
+ " msr control, r3 \n" /* Write back the new control register value. */
135
138
" adds r0, #32 \n" /* Discard everything up to r0. */
136
139
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
137
140
" isb \n"
Original file line number Diff line number Diff line change 1
1
/*
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and/or its affiliates
5
+ * <open-source-office@arm.com>
4
6
*
5
7
* SPDX-License-Identifier: MIT
6
8
*
130
132
" \n"
131
133
" ldm r0!, {r1-r2} \n" /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
132
134
" msr psplim, r1 \n" /* Set this task's PSPLIM value. */
133
- " movs r1, #2 \n" /* r1 = 2. */
134
- " msr CONTROL, r1 \n" /* Switch to use PSP in the thread mode. */
135
+ " mrs r3, control \n" /* Obtain current control register value. */
136
+ " orrs r3, r3, #2 \n" /* r3 = r3 | 0x2. */
137
+ " msr control, r3 \n" /* Write back the new control register value. */
135
138
" adds r0, #32 \n" /* Discard everything up to r0. */
136
139
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
137
140
" isb \n"
Original file line number Diff line number Diff line change 1
1
/*
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and/or its affiliates
5
+ * <open-source-office@arm.com>
4
6
*
5
7
* SPDX-License-Identifier: MIT
6
8
*
130
132
" \n"
131
133
" ldm r0!, {r1-r2} \n" /* Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. */
132
134
" msr psplim, r1 \n" /* Set this task's PSPLIM value. */
133
- " movs r1, #2 \n" /* r1 = 2. */
134
- " msr CONTROL, r1 \n" /* Switch to use PSP in the thread mode. */
135
+ " mrs r3, control \n" /* Obtain current control register value. */
136
+ " orrs r3, r3, #2 \n" /* r3 = r3 | 0x2. */
137
+ " msr control, r3 \n" /* Write back the new control register value. */
135
138
" adds r0, #32 \n" /* Discard everything up to r0. */
136
139
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
137
140
" isb \n"
Original file line number Diff line number Diff line change 1
1
/ *
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com , Inc . or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and / or its affiliates
5
+ * <open - source - office@arm.com>
4
6
*
5
7
* SPDX - License - Identifier: MIT
6
8
*
@@ -165,8 +167,9 @@ vRestoreContextOfFirstTask:
165
167
166
168
ldm r0! , {r1 - r2} / * Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. * /
167
169
msr psplim , r1 / * Set this task's PSPLIM value. * /
168
- movs r1 , # 2 / * r1 = 2 . * /
169
- msr CONTROL , r1 / * Switch to use PSP in the thread mode. * /
170
+ mrs r3 , control / * Obtain current control register value. * /
171
+ orrs r3 , r3 , # 2 / * r3 = r3 | 0x2 * /
172
+ msr control , r3 / * Write back the new control register value. * /
170
173
adds r0 , # 32 / * Discard everything up to r0. * /
171
174
msr psp , r0 / * This is now the new top of stack to use in the task. * /
172
175
isb
Original file line number Diff line number Diff line change 1
1
/ *
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com , Inc . or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and / or its affiliates
5
+ * <open - source - office@arm.com>
4
6
*
5
7
* SPDX - License - Identifier: MIT
6
8
*
@@ -165,8 +167,9 @@ vRestoreContextOfFirstTask:
165
167
166
168
ldm r0! , {r1 - r2} / * Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. * /
167
169
msr psplim , r1 / * Set this task's PSPLIM value. * /
168
- movs r1 , # 2 / * r1 = 2 . * /
169
- msr CONTROL , r1 / * Switch to use PSP in the thread mode. * /
170
+ mrs r3 , control / * Obtain current control register value. * /
171
+ orrs r3 , r3 , # 2 / * r3 = r3 | 0x2 * /
172
+ msr control , r3 / * Write back the new control register value. * /
170
173
adds r0 , # 32 / * Discard everything up to r0. * /
171
174
msr psp , r0 / * This is now the new top of stack to use in the task. * /
172
175
isb
Original file line number Diff line number Diff line change 1
1
/ *
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com , Inc . or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and / or its affiliates
5
+ * <open - source - office@arm.com>
4
6
*
5
7
* SPDX - License - Identifier: MIT
6
8
*
@@ -165,8 +167,9 @@ vRestoreContextOfFirstTask:
165
167
166
168
ldm r0! , {r1 - r2} / * Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. * /
167
169
msr psplim , r1 / * Set this task's PSPLIM value. * /
168
- movs r1 , # 2 / * r1 = 2 . * /
169
- msr CONTROL , r1 / * Switch to use PSP in the thread mode. * /
170
+ mrs r3 , control / * Obtain current control register value. * /
171
+ orrs r3 , r3 , # 2 / * r3 = r3 | 0x2 * /
172
+ msr control , r3 / * Write back the new control register value. * /
170
173
adds r0 , # 32 / * Discard everything up to r0. * /
171
174
msr psp , r0 / * This is now the new top of stack to use in the task. * /
172
175
isb
Original file line number Diff line number Diff line change 1
1
/ *
2
2
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3
3
* Copyright (C) 2021 Amazon.com , Inc . or its affiliates. All Rights Reserved.
4
+ * Copyright 2024 Arm Limited and / or its affiliates
5
+ * <open - source - office@arm.com>
4
6
*
5
7
* SPDX - License - Identifier: MIT
6
8
*
@@ -165,8 +167,9 @@ vRestoreContextOfFirstTask:
165
167
166
168
ldm r0! , {r1 - r2} / * Read from stack - r1 = PSPLIM and r2 = EXC_RETURN. * /
167
169
msr psplim , r1 / * Set this task's PSPLIM value. * /
168
- movs r1 , # 2 / * r1 = 2 . * /
169
- msr CONTROL , r1 / * Switch to use PSP in the thread mode. * /
170
+ mrs r3 , control / * Obtain current control register value. * /
171
+ orrs r3 , r3 , # 2 / * r3 = r3 | 0x2 * /
172
+ msr control , r3 / * Write back the new control register value. * /
170
173
adds r0 , # 32 / * Discard everything up to r0. * /
171
174
msr psp , r0 / * This is now the new top of stack to use in the task. * /
172
175
isb
You can’t perform that action at this time.
0 commit comments