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