• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * Copyright 2019, The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef LIBTEEUI_INCLUDE_TEEUI_INCFONT_H_
19 #define LIBTEEUI_INCLUDE_TEEUI_INCFONT_H_
20 
21 #ifdef __ASSEMBLY__
22 .macro TEEUI_ASM_INCFONT fontname, filename
23 .section .rodata
24 .align 4
25 .globl \fontname
26 \fontname:
27 .incbin "\filename"
28 .section .rodata
29 .align 1
30 \fontname\()_end:
31 .section .rodata
32 .align 4;
33 .globl \fontname\()_length
34 \fontname\()_length:
35 .long \fontname\()_end - \fontname - 1
36 .endmacro
37 
38 #define TEEUI_INCFONT(fontname, filename) TEEUI_ASM_INCFONT fontname, filename
39 #else
40 
41 #define TEEUI_INCFONT(fontname, ...)                                                               \
42     extern unsigned char fontname[];                                                               \
43     extern unsigned int fontname##_length
44 
45 #endif
46 
47 #endif  // LIBTEEUI_INCLUDE_TEEUI_INCFONT_H_
48