mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-05 13:21:37 +00:00
[LibOS] Clean up PAUSE macros
This commit is contained in:
committed by
Dmitrii Kuvaiskii
parent
01eea09519
commit
2b4e50c9bb
@@ -145,20 +145,16 @@ static inline PAL_HANDLE __open_shim_stdio (void)
|
||||
return shim_stdio;
|
||||
}
|
||||
|
||||
#define USE_PAUSE 0
|
||||
|
||||
static inline void do_pause (void);
|
||||
|
||||
#if USE_PAUSE == 1
|
||||
# define PAUSE() do { do_pause(); } while (0)
|
||||
#if 0
|
||||
# define DEBUG_BREAK_ON_FAILURE() DEBUG_BREAK()
|
||||
#else
|
||||
# define PAUSE() do { __asm__ volatile ("int $3"); } while (0)
|
||||
# define DEBUG_BREAK_ON_FAILURE() do {} while (0)
|
||||
#endif
|
||||
|
||||
#define BUG() \
|
||||
do { \
|
||||
__SYS_PRINTF("BUG() " __FILE__ ":%d\n", __LINE__); \
|
||||
PAUSE(); \
|
||||
DEBUG_BREAK_ON_FAILURE(); \
|
||||
shim_clean_and_exit(-ENOTRECOVERABLE); \
|
||||
} while (0)
|
||||
|
||||
@@ -679,13 +675,6 @@ static inline void clear_event (AEVENTTYPE * e)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void do_pause (void)
|
||||
{
|
||||
bool go = false;
|
||||
while (!go)
|
||||
DkThreadDelayExecution(60 * 60 * 1000000ULL);
|
||||
}
|
||||
|
||||
/* reference counter APIs */
|
||||
#define REF_GET(ref) atomic_read(&(ref))
|
||||
#define REF_SET(ref, count) atomic_set(&(ref), count)
|
||||
|
||||
@@ -278,7 +278,7 @@ static inline void internal_fault(const char* errstr,
|
||||
addr, context ? context->IP : 0,
|
||||
cur_process.vmid, is_internal_tid(tid) ? 0 : tid);
|
||||
|
||||
PAUSE();
|
||||
DEBUG_BREAK_ON_FAILURE();
|
||||
}
|
||||
|
||||
static void arithmetic_error_upcall (PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context)
|
||||
|
||||
@@ -66,7 +66,7 @@ static void handle_failure (PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context)
|
||||
}
|
||||
|
||||
noreturn void __abort(void) {
|
||||
PAUSE();
|
||||
DEBUG_BREAK_ON_FAILURE();
|
||||
shim_clean_and_exit(-ENOTRECOVERABLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ typedef ptrdiff_t ssize_t;
|
||||
#define ARRAY_SIZE(a) (FORCE_STATIC_ARRAY(a) + sizeof(a) / sizeof(a[0]))
|
||||
#endif
|
||||
|
||||
#define DEBUG_BREAK() do { __asm__ volatile ("int $3"); } while (0)
|
||||
|
||||
#ifndef container_of
|
||||
/**
|
||||
* container_of - cast a member of a structure out to the containing structure
|
||||
|
||||
Reference in New Issue
Block a user