From ac3e61a7a6b8f56b74d4ebd9c0fcb9c5935294b1 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sun, 25 Jul 2010 18:08:54 +0200 Subject: core: Add some generic panic handling This also includes an option for a minimal 'infinite loop' type panic that could be required for embedded target that don't have abort() or fprintf() Signed-off-by: Sylvain Munaut --- include/osmocore/Makefile.am | 2 +- include/osmocore/panic.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 include/osmocore/panic.h (limited to 'include') diff --git a/include/osmocore/Makefile.am b/include/osmocore/Makefile.am index 8334f148..ecdc65c9 100644 --- a/include/osmocore/Makefile.am +++ b/include/osmocore/Makefile.am @@ -2,7 +2,7 @@ osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h \ tlv.h bitvec.h comp128.h statistics.h gsm_utils.h utils.h \ gsmtap.h write_queue.h rsl.h gsm48.h rxlev_stat.h mncc.h \ gsm48_ie.h logging.h gsm0808.h rate_ctr.h gsmtap_util.h \ - plugin.h crc16.h + plugin.h crc16.h panic.h if ENABLE_TALLOC osmocore_HEADERS += talloc.h diff --git a/include/osmocore/panic.h b/include/osmocore/panic.h new file mode 100644 index 00000000..cee95358 --- /dev/null +++ b/include/osmocore/panic.h @@ -0,0 +1,11 @@ +#ifndef OSMOCORE_PANIC_H +#define OSMOCORE_PANIC_H + +#include + +typedef void (*osmo_panic_handler_t)(const char *fmt, va_list args); + +void osmo_panic(const char *fmt, ...); +void osmo_set_panic_handler(osmo_panic_handler_t *h); + +#endif -- cgit v1.2.3