Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers magic_exports.h Source File

magic_exports.h

00001 /*
00002  * Copyright (c) 2016, ARM Limited, All Rights Reserved
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00006  * not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #ifndef __UVISOR_API_MAGIC_EXPORTS_H__
00018 #define __UVISOR_API_MAGIC_EXPORTS_H__
00019 
00020 #include <stdint.h>
00021 
00022 /* udf imm16
00023  * UDF - ARMv7M ARM section A7.7.191
00024  * 111 1;0 111;1111; <imm4>; 1 01 0; <imm12> (Encoding T2)
00025  */
00026 #define UDF_OPCODE(imm16) \
00027     ((uint32_t) (0xA000F7F0UL | (((uint32_t) (imm16) & 0xFFFU) << 16U) | (((uint32_t) (imm16) & 0xF000UL) >> 12)))
00028 
00029 /** Magics
00030  *
00031  * The following magics are used to verify various things within uVisor.The
00032  * magics are chosen to be one of the explicitly undefined Thumb-2
00033  * instructions.
00034  */
00035 #if defined(__thumb__) && defined(__thumb2__)
00036 #define UVISOR_RPC_GATEWAY_MAGIC_ASYNC UDF_OPCODE(0x07C2)
00037 #define UVISOR_RPC_GATEWAY_MAGIC_SYNC  UDF_OPCODE(0x07C3)
00038 #define UVISOR_POOL_MAGIC              UDF_OPCODE(0x07C4)
00039 #define UVISOR_POOL_QUEUE_MAGIC        UDF_OPCODE(0x07C5)
00040 #define UVISOR_DEBUG_BOX_MAGIC         UDF_OPCODE(0x07C6)
00041 #else
00042 #error "Unsupported instruction set. The ARM Thumb-2 instruction set must be supported."
00043 #endif /* __thumb__ && __thumb2__ */
00044 
00045 
00046 #endif /* __UVISOR_API_MAGIC_EXPORTS_H__ */