Software APIs
hardened.c
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
6 
7 // `extern` declarations to give the inline functions in the corresponding
8 // header a link location.
9 
10 extern uint32_t launder32(uint32_t);
11 extern uintptr_t launderw(uintptr_t);
12 extern void barrier32(uint32_t);
13 extern void barrierw(uintptr_t);
14 
15 extern ct_bool32_t ct_sltz32(int32_t);
16 extern ct_bool32_t ct_sltu32(uint32_t, uint32_t);
17 extern ct_bool32_t ct_sgeu32(uint32_t, uint32_t);
18 extern ct_bool32_t ct_seqz32(uint32_t);
19 extern ct_bool32_t ct_seq32(uint32_t, uint32_t);
20 extern uint32_t ct_cmov32(ct_bool32_t, uint32_t, uint32_t);
21 
22 extern ct_boolw_t ct_sltzw(intptr_t);
23 extern ct_boolw_t ct_sltuw(uintptr_t, uintptr_t);
24 extern ct_boolw_t ct_sgeuw(uintptr_t, uintptr_t);
25 extern ct_boolw_t ct_seqzw(uintptr_t);
26 extern ct_boolw_t ct_seqw(uintptr_t, uintptr_t);
27 extern uintptr_t ct_cmovw(ct_boolw_t, uintptr_t, uintptr_t);