xref: /arm-trusted-firmware/include/drivers/console_assertions.h (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu /*
2*91f16700Schasinglulu  * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3*91f16700Schasinglulu  *
4*91f16700Schasinglulu  * SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu  */
6*91f16700Schasinglulu 
7*91f16700Schasinglulu #ifndef CONSOLE_ASSERTIONS_H
8*91f16700Schasinglulu #define CONSOLE_ASSERTIONS_H
9*91f16700Schasinglulu 
10*91f16700Schasinglulu #include <lib/cassert.h>
11*91f16700Schasinglulu 
12*91f16700Schasinglulu /*
13*91f16700Schasinglulu  * This file contains some separate assertions about console_t, moved here to
14*91f16700Schasinglulu  * keep them out of the way. Should only be included from <console.h>.
15*91f16700Schasinglulu  */
16*91f16700Schasinglulu CASSERT(CONSOLE_T_NEXT == __builtin_offsetof(console_t, next),
17*91f16700Schasinglulu 	assert_console_t_next_offset_mismatch);
18*91f16700Schasinglulu CASSERT(CONSOLE_T_FLAGS == __builtin_offsetof(console_t, flags),
19*91f16700Schasinglulu 	assert_console_t_flags_offset_mismatch);
20*91f16700Schasinglulu CASSERT(CONSOLE_T_PUTC == __builtin_offsetof(console_t, putc),
21*91f16700Schasinglulu 	assert_console_t_putc_offset_mismatch);
22*91f16700Schasinglulu #if ENABLE_CONSOLE_GETC
23*91f16700Schasinglulu CASSERT(CONSOLE_T_GETC == __builtin_offsetof(console_t, getc),
24*91f16700Schasinglulu 	assert_console_t_getc_offset_mismatch);
25*91f16700Schasinglulu #endif
26*91f16700Schasinglulu CASSERT(CONSOLE_T_FLUSH == __builtin_offsetof(console_t, flush),
27*91f16700Schasinglulu 	assert_console_t_flush_offset_mismatch);
28*91f16700Schasinglulu CASSERT(CONSOLE_T_DRVDATA == sizeof(console_t),
29*91f16700Schasinglulu 	assert_console_t_drvdata_offset_mismatch);
30*91f16700Schasinglulu 
31*91f16700Schasinglulu #endif /* CONSOLE_ASSERTIONS_H */
32