Compiles with new changes but not still in progress

This commit is contained in:
Bahadir Balban
2009-11-22 00:17:58 +02:00
parent a3cfa2ac9b
commit f1efee2475
3 changed files with 19 additions and 10 deletions

View File

@@ -12,6 +12,7 @@
#include <l4/lib/memcache.h>
#include INC_GLUE(memory.h)
#include INC_ARCH(linker.h)
#include INC_PLAT(platform.h)
#include <l4/api/errno.h>
struct kernel_resources kernel_resources;
@@ -290,7 +291,7 @@ int memcap_unmap(struct cap_list *used_list,
/* Check for intersection */
if (set_intersection(unmap_start, unmap_end,
cap->start, cap->end)) {
if ((err = memcap_unmap_range(cap, cap_list,
if ((ret = memcap_unmap_range(cap, cap_list,
unmap_start,
unmap_end))) {
goto out_err;
@@ -330,19 +331,21 @@ out_err:
int memcap_request_device(struct cap_list *cap_list,
struct cap_info *devcap)
{
struct capability *cap, *n;
list_foreach_removable_struct(cap, n, &cap_list->caps, list) {
if (cap->start == devcap->start &&
cap->end == devcap->end &&
cap->uattr == devcap->uattr) {
/* Unlink only. This is boot memory */
list_remove(&cap);
list_remove(&cap->list);
return 0;
}
}
printk("%s: FATAL: Device memory requested "
"does not match any available device "
"capabilities start=0x%lx, end=0x%lx "
"uattr=0x%lx\n", __KERNELNAME__,
"uattr=0x%x\n", __KERNELNAME__,
__pfn_to_addr(devcap->start),
__pfn_to_addr(devcap->end), devcap->uattr);
BUG();
@@ -842,12 +845,12 @@ int process_cap_info(struct cap_info *cap,
if (cap_type(cap) == CAP_TYPE_MAP_VIRTMEM) {
memcap_unmap(&kres->virtmem_used,
&kres->virtmem_free,
cap->start, cap->end)
cap->start, cap->end);
} else if (cap_type(cap) == CAP_TYPE_MAP_PHYSMEM) {
if (!cap_devmem(cap))
memcap_unmap(&kres->physmem_used,
&kres->physmem_free,
cap->start, cap->end)
cap->start, cap->end);
else /* Delete device from free list */
memcap_request_device(&kres->devmem_free, cap);
}

View File

@@ -3,11 +3,10 @@
*
* Copyright (C) 2007 Bahadir Balban
*/
#include <l4/generic/capability.h>
#include <l4/generic/cap-types.h>
#include <l4/generic/platform.h>
#include <l4/generic/space.h>
#include <l4/generic/irq.h>
#include <l4/generic/bootmem.h>
#include INC_ARCH(linker.h)
#include INC_PLAT(printascii.h)
#include INC_SUBARCH(mm.h)
@@ -27,7 +26,8 @@
*/
int platform_setup_device_caps(struct kernel_resources *kres)
{
struct capability *uart[4], *timer[2], *irqctrl[2], *sysctrl;
struct capability *uart[4], *timer[2];
// struct capability *irqctrl[2], *sysctrl;
#if 0
/* Setup kernel capability for uart0 as used */
@@ -71,7 +71,7 @@ int platform_setup_device_caps(struct kernel_resources *kres)
#endif
/* Setup capabilities for other uarts as free */
uart[1] = alloc_bootmem(sizeof(*uart[i]), 0);
uart[1] = alloc_bootmem(sizeof(*uart[1]), 0);
uart[1]->start = __pfn(PB926_UART1_BASE);
uart[1]->end = uart[1]->start + 1;
uart[1]->uattr = CAP_DEVTYPE_UART;
@@ -94,11 +94,13 @@ int platform_setup_device_caps(struct kernel_resources *kres)
/* Setup timer1 capability as free */
timer[1] = alloc_bootmem(sizeof(*timer[1]), 0);
timer[1]->start = __pfn(PB926_TIMER12_BASE);
timer[1]->start = __pfn(PB926_TIMER23_BASE);
timer[1]->end = timer[1]->start + 1;
timer[1]->uattr = CAP_DEVTYPE_TIMER;
link_init(&timer[1]->list);
cap_list_insert(timer[1], &kres->devmem_free);
return 0;
}
/* We will use UART0 for kernel as well as user tasks, so map it to kernel and user space */