Morello 02alpha
Morello 02alpha
Extensions
Release Date: 11 January 2022
Version: 02alpha
Contents
1 Preface 3
1.1 Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Latest release and defects report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5.1 About the license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Trademark notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.8 Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Scope 7
4 Predefined macros 8
4.1 __ARM_FEATURE_C64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Capability Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Deviation from CHERI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5 Builtin functions 9
5.1 Check subset and conditionally unseal or return null . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Check subset and conditionally unseal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 Convert pointer to capability offset (zeroing form) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Preface
1.1 Warning
1.2 Abstract
This document specifies the Arm C Language Extensions to enable C/C++ programmers to use the Morello archi-
tecture with minimal restrictions on source code portability.
1.3 Keywords
Predefined macros, built-in functions
1.5 License
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy
of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box
1866, Mountain View, CA 94042, USA.
Grant of Patent License. Subject to the terms and conditions of this license (both the Public License and this Patent
License), each Licensor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irre-
vocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and
otherwise transfer the Licensed Material, where such license applies only to those patent claims licensable by such
Licensor that are necessarily infringed by their contribution(s) alone or by combination of their contribution(s) with
the Licensed Material to which such contribution(s) was submitted. If You institute patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Licensed Material or a contribution
incorporated within the Licensed Material constitutes direct or contributory patent infringement, then any licenses
granted to You under this license for that Licensed Material shall terminate as of the date such litigation is filed.
1.6 Contributions
Contributions to this project are licensed under an inbound=outbound model such that any such contributions are
licensed by the contributor under the same terms as those in the LICENSE file.
We do not require copyright assignment. The original contributor will retain the copyright.
1.8 Copyright
Copyright (c) 2020-2022, Arm Limited and its affiliates. All rights reserved.
2.2 References
This document refers to, or is referred to by, the following documents.
Copyright 2020-2022 Arm Limited and/or its affiliates open-source-offi[email protected].
Page 5 of 9
Morello Supplement to the Arm C Language Extensions Version: 02alpha
About This Document
3. Scope
The Morello Supplement to the Arm C Language Extensions highlights the language features added on top of the
CHERI programming language to further exploit the Morello architecture. We recommend reading the CHERI Pure-
Capability C/C++ Programming Guide and the CHERI-HYBRID CHERI Hybrid C/C++ Programming Guide as preliminary
material.
4. Predefined macros
ACLE introduces several predefined macros that define how the C/C++ implementation uses the Morello architec-
ture.
4.1 __ARM_FEATURE_C64
This macro indicates that the code is being compiled for the C64 ISA.
Name Value
__ARM_CAP_PERMISSION_EXECUTIVE__ 2
__ARM_CAP_PERMISSION_MUTABLE_LOAD__ 64
__ARM_CAP_PERMISSION_COMPARTMENT_ID__ 128
__ARM_CAP_PERMISSION_BRANCH_SEALED_PAIR__ 256
Those can be used to form a bitmask that is acceptable for cheri_perms_and() and cheri_perms_clear(). The
value of each macro corresponds to the permission bit as it appears in the architecture documentation.
5. Builtin functions
ACLE standardizes builtin functions to access the Morello architecture. These are the following: