mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
parent
6223ae4413
commit
755aed7cb2
@ -28,7 +28,7 @@ CC_CXX_OPT = -fpermissive
|
|||||||
SRC_CC = dummies.cc lxcc_emul.cc nic_handler.cc \
|
SRC_CC = dummies.cc lxcc_emul.cc nic_handler.cc \
|
||||||
timer_handler.cc random.cc
|
timer_handler.cc random.cc
|
||||||
|
|
||||||
SRC_CC += malloc.cc printf.cc env.cc
|
SRC_CC += malloc.cc printf.cc bug.cc env.cc
|
||||||
|
|
||||||
SRC_C += driver.c dummies_c.c lxc_emul.c
|
SRC_C += driver.c dummies_c.c lxc_emul.c
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ SRC_CC += dummies.cc init.cc lxcc_emul.cc nic.cc socket_call.cc random.cc \
|
|||||||
|
|
||||||
# lx_kit
|
# lx_kit
|
||||||
SRC_CC += mapped_io_mem_range.cc irq.cc pci.cc malloc.cc scheduler.cc \
|
SRC_CC += mapped_io_mem_range.cc irq.cc pci.cc malloc.cc scheduler.cc \
|
||||||
work.cc timer.cc printf.cc env.cc
|
work.cc timer.cc printf.cc bug.cc env.cc
|
||||||
|
|
||||||
SRC_C += lxc_emul.c dummies_new.c
|
SRC_C += lxc_emul.c dummies_new.c
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ SRC_C = dummies.c lx_emul_c.c
|
|||||||
|
|
||||||
# lx_kit
|
# lx_kit
|
||||||
SRC_CC += printf.cc \
|
SRC_CC += printf.cc \
|
||||||
|
bug.cc \
|
||||||
env.cc \
|
env.cc \
|
||||||
irq.cc \
|
irq.cc \
|
||||||
malloc.cc \
|
malloc.cc \
|
||||||
|
@ -11,6 +11,7 @@ SRC_CC += irq.cc \
|
|||||||
mapped_io_mem_range.cc \
|
mapped_io_mem_range.cc \
|
||||||
pci.cc \
|
pci.cc \
|
||||||
printf.cc \
|
printf.cc \
|
||||||
|
bug.cc \
|
||||||
scheduler.cc \
|
scheduler.cc \
|
||||||
timer.cc \
|
timer.cc \
|
||||||
work.cc \
|
work.cc \
|
||||||
|
@ -7,7 +7,7 @@ INC_DIR += $(PRG_DIR)/../..
|
|||||||
INC_DIR += $(REP_DIR)/src/drivers/nic
|
INC_DIR += $(REP_DIR)/src/drivers/nic
|
||||||
|
|
||||||
# lx_kit
|
# lx_kit
|
||||||
SRC_CC += env.cc irq.cc malloc.cc scheduler.cc timer.cc work.cc printf.cc
|
SRC_CC += env.cc irq.cc malloc.cc scheduler.cc timer.cc work.cc printf.cc bug.cc
|
||||||
INC_DIR += $(REP_DIR)/src/include
|
INC_DIR += $(REP_DIR)/src/include
|
||||||
|
|
||||||
# contrib code
|
# contrib code
|
||||||
|
@ -43,7 +43,7 @@ MOD_SUFFIX =
|
|||||||
CC_OPT += -DMOD_SUFFIX=$(MOD_SUFFIX)
|
CC_OPT += -DMOD_SUFFIX=$(MOD_SUFFIX)
|
||||||
|
|
||||||
# lx_kit
|
# lx_kit
|
||||||
SRC_CC += printf.cc work.cc timer.cc scheduler.cc irq.cc malloc.cc env.cc
|
SRC_CC += printf.cc bug.cc work.cc timer.cc scheduler.cc irq.cc malloc.cc env.cc
|
||||||
|
|
||||||
# common lib
|
# common lib
|
||||||
SRC_C += lib/ctype.c
|
SRC_C += lib/ctype.c
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
TARGET := usb_hid_drv
|
TARGET := usb_hid_drv
|
||||||
SRC_C := dummies.c
|
SRC_C := dummies.c
|
||||||
SRC_CC := main.cc lx_emul.cc evdev.cc
|
SRC_CC := main.cc lx_emul.cc evdev.cc
|
||||||
SRC_CC += printf.cc timer.cc scheduler.cc env.cc work.cc
|
SRC_CC += printf.cc bug.cc timer.cc scheduler.cc env.cc work.cc
|
||||||
|
|
||||||
LIBS := base usb_hid_include lx_kit_setjmp
|
LIBS := base usb_hid_include lx_kit_setjmp
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ INC_DIR += $(REP_DIR)/src/include
|
|||||||
|
|
||||||
# lx_kit
|
# lx_kit
|
||||||
SRC_CC += lx_kit/printf.cc
|
SRC_CC += lx_kit/printf.cc
|
||||||
|
SRC_CC += lx_kit/bug.cc
|
||||||
SRC_CC += lx_kit/work.cc
|
SRC_CC += lx_kit/work.cc
|
||||||
SRC_CC += lx_kit/timer.cc
|
SRC_CC += lx_kit/timer.cc
|
||||||
SRC_CC += lx_kit/scheduler.cc
|
SRC_CC += lx_kit/scheduler.cc
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
TARGET := usb_modem_drv
|
TARGET := usb_modem_drv
|
||||||
SRC_C := dummies.c lxc.c
|
SRC_C := dummies.c lxc.c
|
||||||
SRC_CC := main.cc lx_emul.cc component.cc terminal.cc fec_nic.cc
|
SRC_CC := main.cc lx_emul.cc component.cc terminal.cc fec_nic.cc
|
||||||
SRC_CC += printf.cc timer.cc scheduler.cc malloc.cc env.cc work.cc
|
SRC_CC += printf.cc bug.cc timer.cc scheduler.cc malloc.cc env.cc work.cc
|
||||||
SRC_CC += uplink_client.cc
|
SRC_CC += uplink_client.cc
|
||||||
|
|
||||||
LIBS := base usb_modem_include lx_kit_setjmp nic_driver
|
LIBS := base usb_modem_include lx_kit_setjmp nic_driver
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
TARGET := usb_net_drv
|
TARGET := usb_net_drv
|
||||||
SRC_C := dummies.c lxc.c
|
SRC_C := dummies.c lxc.c
|
||||||
SRC_CC := main.cc lx_emul.cc component.cc linux_network_session_base.cc
|
SRC_CC := main.cc lx_emul.cc component.cc linux_network_session_base.cc
|
||||||
SRC_CC += printf.cc timer.cc scheduler.cc malloc.cc env.cc work.cc
|
SRC_CC += printf.cc bug.cc timer.cc scheduler.cc malloc.cc env.cc work.cc
|
||||||
SRC_CC += uplink_client.cc
|
SRC_CC += uplink_client.cc
|
||||||
|
|
||||||
LIBS := base usb_net_include lx_kit_setjmp nic_driver
|
LIBS := base usb_net_include lx_kit_setjmp nic_driver
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
** asm/bug.h **
|
** asm/bug.h **
|
||||||
***************/
|
***************/
|
||||||
|
|
||||||
|
extern void lx_sleep_forever() __attribute__((noreturn));
|
||||||
|
|
||||||
#define WARN_ON(condition) ({ \
|
#define WARN_ON(condition) ({ \
|
||||||
int ret = !!(condition); \
|
int ret = !!(condition); \
|
||||||
if (ret) lx_printf("[%s] WARN_ON(%s) \n", __func__, #condition); \
|
if (ret) lx_printf("[%s] WARN_ON(%s) \n", __func__, #condition); \
|
||||||
@ -31,7 +33,7 @@
|
|||||||
|
|
||||||
#define BUG() do { \
|
#define BUG() do { \
|
||||||
lx_printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
|
lx_printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
|
||||||
while (1); \
|
lx_sleep_forever(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define WARN_ON_ONCE WARN_ON
|
#define WARN_ON_ONCE WARN_ON
|
||||||
|
@ -71,6 +71,9 @@ static inline int _printk(const char *fmt, ...)
|
|||||||
#define vprintk(...)
|
#define vprintk(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern void lx_sleep_forever() __attribute__((noreturn));
|
||||||
|
|
||||||
|
|
||||||
static inline __printf(1, 2) void panic(const char *fmt, ...) __noreturn;
|
static inline __printf(1, 2) void panic(const char *fmt, ...) __noreturn;
|
||||||
static inline void panic(const char *fmt, ...)
|
static inline void panic(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -79,7 +82,7 @@ static inline void panic(const char *fmt, ...)
|
|||||||
lx_vprintf(fmt, args);
|
lx_vprintf(fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
lx_printf("\npanic()\n");
|
lx_printf("\npanic()\n");
|
||||||
while (1) ;
|
lx_sleep_forever();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
26
repos/dde_linux/src/lx_kit/bug.cc
Normal file
26
repos/dde_linux/src/lx_kit/bug.cc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* \brief C ABI for panicking / blocking forever
|
||||||
|
* \author Norman Feske
|
||||||
|
* \date 2021-03-08
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is distributed under the terms of the GNU General Public License
|
||||||
|
* version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Genode includes */
|
||||||
|
#include <base/sleep.h>
|
||||||
|
|
||||||
|
/* Linux emulation environment includes */
|
||||||
|
#include <lx_emul/extern_c_begin.h>
|
||||||
|
#include <lx_emul/bug.h>
|
||||||
|
#include <lx_emul/extern_c_end.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" void lx_sleep_forever()
|
||||||
|
{
|
||||||
|
Genode::sleep_forever();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user