Spaces:
Runtime error
Runtime error
| /* | |
| * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License, version 2, as | |
| * published by the Free Software Foundation. | |
| * | |
| * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | |
| * | |
| * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | |
| * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| * | |
| * Copyright IBM Corp. 2008 | |
| * | |
| * Authors: Hollis Blanchard <hollisb@us.ibm.com> | |
| */ | |
| typedef uint8_t u8; | |
| typedef int8_t s8; | |
| typedef uint16_t u16; | |
| typedef int16_t s16; | |
| typedef uint32_t u32; | |
| typedef int32_t s32; | |
| typedef uint64_t u64; | |
| typedef int64_t s64; | |
| typedef unsigned long ulong; | |
| typedef _Bool bool; | |
| typedef u64 phys_addr_t; | |
| extern void puts(const char *s); | |
| extern void exit(int code); | |
| extern void abort(void); | |
| extern long atol(const char *ptr); | |
| extern char *getenv(const char *name); | |
| extern int printf(const char *fmt, ...) | |
| __attribute__((format(printf, 1, 2))); | |
| extern int snprintf(char *buf, int size, const char *fmt, ...) | |
| __attribute__((format(printf, 3, 4))); | |
| extern int vsnprintf(char *buf, int size, const char *fmt, va_list va) | |
| __attribute__((format(printf, 3, 0))); | |
| extern int vprintf(const char *fmt, va_list va) | |
| __attribute__((format(printf, 1, 0))); | |
| void report_prefix_pushf(const char *prefix_fmt, ...) | |
| __attribute__((format(printf, 1, 2))); | |
| extern void report_prefix_push(const char *prefix); | |
| extern void report_prefix_pop(void); | |
| extern void report(const char *msg_fmt, bool pass, ...) | |
| __attribute__((format(printf, 1, 3))); | |
| extern void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...) | |
| __attribute__((format(printf, 1, 4))); | |
| extern void report_abort(const char *msg_fmt, ...) | |
| __attribute__((format(printf, 1, 2))); | |
| extern void report_skip(const char *msg_fmt, ...) | |
| __attribute__((format(printf, 1, 2))); | |
| extern void report_info(const char *msg_fmt, ...) | |
| __attribute__((format(printf, 1, 2))); | |
| extern void report_pass(void); | |
| extern int report_summary(void); | |
| bool simple_glob(const char *text, const char *pattern); | |
| extern void dump_stack(void); | |
| extern void dump_frame_stack(const void *instruction, const void *frame); | |
| static inline bool is_power_of_2(unsigned long n) | |
| { | |
| return n && !(n & (n - 1)); | |
| } | |
| /* | |
| * One byte per bit, a ' between each group of 4 bits, and a null terminator. | |
| */ | |
| void binstr(unsigned long x, char out[BINSTR_SZ]); | |
| void print_binstr(unsigned long x); | |