Merge branch 'rebase' of git://git.l4dev.org/~amit/codezero into devel

Conflicts:
	conts/baremetal/baremetal5/main.c
This commit is contained in:
Bahadir Balban
2009-11-30 15:36:36 +02:00
3 changed files with 36 additions and 9 deletions

View File

@@ -149,8 +149,10 @@ int cap_read_all()
"complete CAP_CONTROL_READ_CAPS request.\n");
BUG();
}
#if 0
cap_array_print(&caparray);
#endif
return 0;
}
@@ -272,6 +274,7 @@ char uart_generic_rx(int devno)
void handle_requests(void)
{
u32 mr[MR_UNUSED_TOTAL];
l4id_t senderid;
u32 tag;
int ret;
@@ -287,6 +290,10 @@ void handle_requests(void)
tag = l4_get_tag();
senderid = l4_get_sender();
/* Read mrs not used by syslib */
for (int i = 0; i < MR_UNUSED_TOTAL; i++)
mr[i] = read_mr(MR_UNUSED_START + i);
/*
* TODO:
*
@@ -298,12 +305,18 @@ void handle_requests(void)
* the request should (currently) come from a task
* inside the current container
*/
/*
* FIXME: Right now we are talking to UART1 by default, we need to define protocol
* for sommunication with UART service
*/
switch (tag) {
case L4_IPC_TAG_UART_SENDCHAR:
uart_generic_tx(0, 1); /*FIXME: Fill in */
printf("got L4_IPC_TAG_UART_SENDCHAR with char %d\n ", mr[0]);
uart_generic_tx((char)mr[0], 0);
break;
case L4_IPC_TAG_UART_RECVCHAR:
uart_generic_rx(1); /* FIXME: Fill in */
mr[0] = (int)uart_generic_rx(0);
break;
default:
printf("%s: Error received ipc from 0x%x residing "

View File

@@ -193,7 +193,7 @@ int timer_setup_devices(void)
for (int i = 0; i < TIMERS_TOTAL; i++) {
/* Get one page from address pool */
timer[i].base = (unsigned long)l4_new_virtual(1);
/* Map timers to a virtual address region */
if (IS_ERR(l4_map((void *)__pfn_to_addr(timer_cap[i].start),
(void *)timer[i].base, timer_cap[i].size, MAP_USR_IO_FLAGS,
@@ -210,7 +210,7 @@ int timer_setup_devices(void)
SP804_TIMER_WRAPMODE_WRAPPING, SP804_TIMER_WIDTH32BIT, \
SP804_TIMER_IRQDISABLE);
/* Enable Timer */
/* Enable Timer */
sp804_enable(timer[i].base, 1);
}
return 0;
@@ -221,7 +221,6 @@ static struct address_pool device_vaddr_pool;
/*
* Initialize a virtual address pool
* for mapping physical devices.
*/
void init_vaddr_pool(void)
{
@@ -262,7 +261,6 @@ out_err:
void *l4_new_virtual(int npages)
{
return address_new(&device_vaddr_pool, npages, PAGE_SIZE);
}
@@ -271,8 +269,16 @@ int timer_gettime(int devno)
return sp804_read_value(timer[devno].base);
}
void timer_sleep(int sec)
{
/*
* TODO: We need to have a timer struct already present to be used
* as reference for us. to implement this call
*/
}
void handle_requests(void)
{
u32 mr[MR_UNUSED_TOTAL];
l4id_t senderid;
u32 tag;
int ret;
@@ -287,7 +293,11 @@ void handle_requests(void)
/* Syslib conventional ipc data which uses first few mrs. */
tag = l4_get_tag();
senderid = l4_get_sender();
/* Read mrs not used by syslib */
for (int i = 0; i < MR_UNUSED_TOTAL; i++)
mr[i] = read_mr(MR_UNUSED_START + i);
/*
* TODO:
*
@@ -304,6 +314,10 @@ void handle_requests(void)
timer_gettime(1);
break;
case L4_IPC_TAG_TIMER_SLEEP:
timer_sleep(mr[0]);
break;
default:
printf("%s: Error received ipc from 0x%x residing "
"in container %x with an unrecognized tag: "

View File

@@ -74,6 +74,6 @@ extern l4id_t pagerid;
/* For ipc to timer service (TODO: Shared mapping buffers???) */
#define L4_IPC_TAG_TIMER_GETTIME 55
#define L4_IPC_TAG_TIMER_SLEEP 56
#endif /* __IPCDEFS_H__ */