Undefined instruction handling/ipc revised, tests added, cleaned up.

This commit is contained in:
Bahadir Balban
2009-12-04 15:22:56 +02:00
parent 93dc1ed49e
commit 2908c40816
7 changed files with 43 additions and 32 deletions

View File

@@ -11,21 +11,17 @@
#include <l4/api/ipc.h>
/* SHMID used betweeen FS0 and BLKDEV0 servers */
#define FS_BLKDEV_SHMID 0
/*** IPC Tags used between server tasks ***/
/*
* Tag 0 for L4_IPC_TAG_PFAULT
* Tag 1 for L4_IPC_TAG_UNDEF_FAULT
*/
/* For ping ponging */
#define L4_IPC_TAG_SYNC_EXTENDED 1
#define L4_IPC_TAG_SYNC_FULL 2
#define L4_IPC_TAG_SYNC 3
/* To obtain default shared page address */
#define L4_IPC_TAG_SHPAGE 4
/* XXX: unused */
#define L4_IPC_TAG_GRANT 5
#define L4_IPC_TAG_SYNC_EXTENDED 3
#define L4_IPC_TAG_SYNC_FULL 4
#define L4_IPC_TAG_SYNC 5
/* Posix system call tags */
#define L4_IPC_TAG_SHMGET 6

View File

@@ -16,6 +16,8 @@
#include <shpage.h>
#include <libposix.h>
#if 0
/*
* Shared page initialisation of posix-like tasks.
*
@@ -95,3 +97,4 @@ int shared_page_init(void)
return 0;
}
#endif

View File

@@ -79,6 +79,11 @@ void handle_requests(void)
/* This has no receive phase */
return;
case L4_IPC_TAG_UNDEF_FAULT:
/* Undefined instruction fault. Ignore. */
// printf("Undefined instruction fault caught.\n");
ret = 0;
break;
case L4_IPC_TAG_PFAULT: {
struct page *p;

View File

@@ -40,8 +40,7 @@ int main(int argc, char *argv[])
wait_pager(pagerid);
printf("\n%s: Running POSIX API tests.\n", __TASKNAME__);
undeftest();
small_io_test();
@@ -57,6 +56,8 @@ int main(int argc, char *argv[])
clonetest();
undeftest();
if (parent_of_all == getpid()) {
ipc_full_test();
ipc_extended_test();

View File

@@ -1,4 +1,4 @@
/*
/*
* undeftest.c:
* Tests to see if kernel gracefully handles the undef exception
*/
@@ -13,17 +13,16 @@
#include <errno.h>
#include INC_GLUE(memory.h)
int undeftest(void)
{
test_printf("UNDEF: Start\n");
/* need a way to report FAIL case */
__asm__ __volatile__(".word 0xf1f0feed\n\t"); /* Some pattern for easy recongition */
/* If code reaches here its passed */
printf("UNDEF TEST -- PASSED --\n");
test_printf("UNDEF: Passed\n");
if (getpid() == parent_of_all)
printf("UNDEF TEST -- PASSED --\n");
return 0;
}
}