mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-05 21:31:36 +00:00
31 lines
538 B
C
31 lines
538 B
C
/* This Hello World simply print out "Hello World" */
|
|
|
|
#include "pal.h"
|
|
#include "pal_debug.h"
|
|
|
|
int count = 0;
|
|
int i = 0;
|
|
|
|
void handler (PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context)
|
|
{
|
|
pal_printf("failure in the handler: 0x%08lx\n", arg);
|
|
count++;
|
|
|
|
if (count == 30)
|
|
DkProcessExit(0);
|
|
|
|
DkExceptionReturn(event);
|
|
}
|
|
|
|
int main (void)
|
|
{
|
|
pal_printf("Enter Main Thread\n");
|
|
|
|
DkSetExceptionHandler(handler, PAL_EVENT_ARITHMETIC_ERROR);
|
|
|
|
i = 1 / i;
|
|
|
|
pal_printf("Leave Main Thread\n");
|
|
return 0;
|
|
}
|