[LibOS] Clean up PAUSE macros

This commit is contained in:
Michał Kowalczyk
2020-04-10 19:23:42 -07:00
committed by Dmitrii Kuvaiskii
parent 01eea09519
commit 2b4e50c9bb
4 changed files with 8 additions and 17 deletions
+4 -15
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
}
+2
View File
@@ -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