blob: ebef43784c99bf13e3abbc3a2ecf374af32ef0d6 [file] [log] [blame]
Stefan Reinauer52fc6b12009-10-24 13:06:04 +00001/*
2 * This file is part of the coreboot project.
Stefan Reinauer14e22772010-04-27 06:56:47 +00003 *
Stefan Reinauer52fc6b12009-10-24 13:06:04 +00004 * Copyright (C) 2009 coresystems GmbH
5 *
Uwe Hermannc70e9fc2010-02-15 23:10:19 +00006 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
Stefan Reinauer52fc6b12009-10-24 13:06:04 +00009 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer52fc6b12009-10-24 13:06:04 +000014 */
15
16#ifndef __CONSOLE_VTXPRINTF_H
17#define __CONSOLE_VTXPRINTF_H
18
Stefan Reinauer68a564f2010-03-16 01:02:18 +000019/* With GCC we use -nostdinc -ffreestanding to keep out system includes.
20 * Unfortunately this also gets us rid of the _compiler_ includes, like
21 * stdarg.h. To work around the issue, we define varargs directly here.
22 * On LLVM we can still just include stdarg.h.
23 */
24#ifdef __GNUC__
Lee Leahyae3fd342017-03-07 12:55:23 -080025#define va_start(v, l) __builtin_va_start(v, l)
Stefan Reinauer68a564f2010-03-16 01:02:18 +000026#define va_end(v) __builtin_va_end(v)
Lee Leahyae3fd342017-03-07 12:55:23 -080027#define va_arg(v, l) __builtin_va_arg(v, l)
Stefan Reinauer68a564f2010-03-16 01:02:18 +000028typedef __builtin_va_list va_list;
29#else
Stefan Reinauer52fc6b12009-10-24 13:06:04 +000030#include <stdarg.h>
Stefan Reinauer68a564f2010-03-16 01:02:18 +000031#endif
Stefan Reinauer52fc6b12009-10-24 13:06:04 +000032
Kyösti Mälkkib04e0ff2014-02-04 14:28:17 +020033int vtxprintf(void (*tx_byte)(unsigned char byte, void *data),
34 const char *fmt, va_list args, void *data);
Vladimir Serbinenkof421b332013-11-26 21:43:05 +010035
Stefan Reinauer52fc6b12009-10-24 13:06:04 +000036#endif