/************************************************************************************ * arch/arm/src/armv8-m/gnu/up_fullcontextrestore.S * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The * ASF licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * ************************************************************************************/ /************************************************************************************ * Included Files ************************************************************************************/ #include #include #include "nvic.h" #include "svcall.h" /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ /************************************************************************************ * Public Symbols ************************************************************************************/ .syntax unified .thumb .file "up_fullcontextrestore.S" /************************************************************************************ * Macros ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ * Name: up_fullcontextrestore * * Description: * Restore the current thread context. Full prototype is: * * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; * * Returned Value: * None * ************************************************************************************/ .thumb_func .globl up_fullcontextrestore .type up_fullcontextrestore, function up_fullcontextrestore: /* Perform the System call with R0=1 and R1=regs */ mov r1, r0 /* R1: regs */ mov r0, #SYS_restore_context /* R0: restore context */ svc 0 /* Force synchronous SVCall (or Hard Fault) */ /* This call should not return */ bx lr /* Unnecessary ... will not return */ .size up_fullcontextrestore, .-up_fullcontextrestore .end