Added helper to extract raw thread id from fully qualified thread id

Currently, the tid returned from kernel contains container id as
well, which makes it sufficient to do inter-container syscalls without
any preparation.

The helpers added are for presentation purposes only. Container id
is deleted so that the raw thread id is available for printing or
similar.
This commit is contained in:
Bahadir Balban
2009-11-05 01:47:04 +02:00
parent d9520adb55
commit fd04e9d460
5 changed files with 24 additions and 3 deletions

View File

@@ -195,7 +195,7 @@ void handle_requests(void)
void main(void)
{
printf("\n%s: Started with thread id %x\n", __TASKNAME__, self_tid());
printf("\n%s: Started with thread id %x\n", __TASKNAME__, __raw_self_tid());
init();

View File

@@ -19,5 +19,7 @@ SECTIONS
.rodata1 : { *(.rodata1) }
. = ALIGN(4K);
.data : { *(.data) }
.got : { *(.got) }
.got.plt : { *(.got.plt) }
.bss : { *(.bss) }
}

View File

@@ -31,7 +31,7 @@ l4id_t pagerid;
int main(int argc, char *argv[])
{
printf("\n%s: Started with thread id %x\n", __TASKNAME__, getpid());
printf("\n%s: Started with thread id %x\n", __TASKNAME__, __raw_tid(getpid()));
parent_of_all = getpid();

View File

@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
/* Compare two pid strings. We use strings because we dont have atoi() */
if (!strcmp(pidbuf, parent_of_all)) {
printf("EXECVE TEST -- PASSED --\n");
printf("\nThread (%x): Continues to sync with the pager...\n\n", getpid());
printf("\nThread (%x): Continues to sync with the pager...\n\n", __raw_tid(getpid()));
while (1)
wait_pager(pagerid);
}