mirror of
https://github.com/drasko/codezero.git
synced 2026-10-16 07:07:01 +02:00
Compiles with new changes but not still in progress
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
|
|
||||||
#include INC_PLAT(offsets.h)
|
#include INC_PLAT(offsets.h)
|
||||||
#include INC_GLUE(memlayout.h)
|
#include INC_GLUE(memlayout.h)
|
||||||
|
#include <l4/generic/capability.h>
|
||||||
|
#include <l4/generic/cap-types.h>
|
||||||
|
#include <l4/generic/resource.h>
|
||||||
|
|
||||||
#define PLATFORM_CONSOLE0_BASE PB926_UART0_VBASE
|
#define PLATFORM_CONSOLE0_BASE PB926_UART0_VBASE
|
||||||
|
|
||||||
@@ -27,6 +30,7 @@
|
|||||||
#define PLATFORM_TIMER2 2
|
#define PLATFORM_TIMER2 2
|
||||||
#define PLATFORM_TIMER3 3
|
#define PLATFORM_TIMER3 3
|
||||||
|
|
||||||
|
int platform_setup_device_caps(struct kernel_resources *kres);
|
||||||
void platform_irq_enable(int irq);
|
void platform_irq_enable(int irq);
|
||||||
void platform_irq_disable(int irq);
|
void platform_irq_disable(int irq);
|
||||||
void timer_start(void);
|
void timer_start(void);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <l4/lib/memcache.h>
|
#include <l4/lib/memcache.h>
|
||||||
#include INC_GLUE(memory.h)
|
#include INC_GLUE(memory.h)
|
||||||
#include INC_ARCH(linker.h)
|
#include INC_ARCH(linker.h)
|
||||||
|
#include INC_PLAT(platform.h)
|
||||||
#include <l4/api/errno.h>
|
#include <l4/api/errno.h>
|
||||||
|
|
||||||
struct kernel_resources kernel_resources;
|
struct kernel_resources kernel_resources;
|
||||||
@@ -290,7 +291,7 @@ int memcap_unmap(struct cap_list *used_list,
|
|||||||
/* Check for intersection */
|
/* Check for intersection */
|
||||||
if (set_intersection(unmap_start, unmap_end,
|
if (set_intersection(unmap_start, unmap_end,
|
||||||
cap->start, cap->end)) {
|
cap->start, cap->end)) {
|
||||||
if ((err = memcap_unmap_range(cap, cap_list,
|
if ((ret = memcap_unmap_range(cap, cap_list,
|
||||||
unmap_start,
|
unmap_start,
|
||||||
unmap_end))) {
|
unmap_end))) {
|
||||||
goto out_err;
|
goto out_err;
|
||||||
@@ -330,19 +331,21 @@ out_err:
|
|||||||
int memcap_request_device(struct cap_list *cap_list,
|
int memcap_request_device(struct cap_list *cap_list,
|
||||||
struct cap_info *devcap)
|
struct cap_info *devcap)
|
||||||
{
|
{
|
||||||
|
struct capability *cap, *n;
|
||||||
|
|
||||||
list_foreach_removable_struct(cap, n, &cap_list->caps, list) {
|
list_foreach_removable_struct(cap, n, &cap_list->caps, list) {
|
||||||
if (cap->start == devcap->start &&
|
if (cap->start == devcap->start &&
|
||||||
cap->end == devcap->end &&
|
cap->end == devcap->end &&
|
||||||
cap->uattr == devcap->uattr) {
|
cap->uattr == devcap->uattr) {
|
||||||
/* Unlink only. This is boot memory */
|
/* Unlink only. This is boot memory */
|
||||||
list_remove(&cap);
|
list_remove(&cap->list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk("%s: FATAL: Device memory requested "
|
printk("%s: FATAL: Device memory requested "
|
||||||
"does not match any available device "
|
"does not match any available device "
|
||||||
"capabilities start=0x%lx, end=0x%lx "
|
"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->start),
|
||||||
__pfn_to_addr(devcap->end), devcap->uattr);
|
__pfn_to_addr(devcap->end), devcap->uattr);
|
||||||
BUG();
|
BUG();
|
||||||
@@ -842,12 +845,12 @@ int process_cap_info(struct cap_info *cap,
|
|||||||
if (cap_type(cap) == CAP_TYPE_MAP_VIRTMEM) {
|
if (cap_type(cap) == CAP_TYPE_MAP_VIRTMEM) {
|
||||||
memcap_unmap(&kres->virtmem_used,
|
memcap_unmap(&kres->virtmem_used,
|
||||||
&kres->virtmem_free,
|
&kres->virtmem_free,
|
||||||
cap->start, cap->end)
|
cap->start, cap->end);
|
||||||
} else if (cap_type(cap) == CAP_TYPE_MAP_PHYSMEM) {
|
} else if (cap_type(cap) == CAP_TYPE_MAP_PHYSMEM) {
|
||||||
if (!cap_devmem(cap))
|
if (!cap_devmem(cap))
|
||||||
memcap_unmap(&kres->physmem_used,
|
memcap_unmap(&kres->physmem_used,
|
||||||
&kres->physmem_free,
|
&kres->physmem_free,
|
||||||
cap->start, cap->end)
|
cap->start, cap->end);
|
||||||
else /* Delete device from free list */
|
else /* Delete device from free list */
|
||||||
memcap_request_device(&kres->devmem_free, cap);
|
memcap_request_device(&kres->devmem_free, cap);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,10 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2007 Bahadir Balban
|
* Copyright (C) 2007 Bahadir Balban
|
||||||
*/
|
*/
|
||||||
#include <l4/generic/capability.h>
|
|
||||||
#include <l4/generic/cap-types.h>
|
|
||||||
#include <l4/generic/platform.h>
|
#include <l4/generic/platform.h>
|
||||||
#include <l4/generic/space.h>
|
#include <l4/generic/space.h>
|
||||||
#include <l4/generic/irq.h>
|
#include <l4/generic/irq.h>
|
||||||
|
#include <l4/generic/bootmem.h>
|
||||||
#include INC_ARCH(linker.h)
|
#include INC_ARCH(linker.h)
|
||||||
#include INC_PLAT(printascii.h)
|
#include INC_PLAT(printascii.h)
|
||||||
#include INC_SUBARCH(mm.h)
|
#include INC_SUBARCH(mm.h)
|
||||||
@@ -27,7 +26,8 @@
|
|||||||
*/
|
*/
|
||||||
int platform_setup_device_caps(struct kernel_resources *kres)
|
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
|
#if 0
|
||||||
/* Setup kernel capability for uart0 as used */
|
/* Setup kernel capability for uart0 as used */
|
||||||
@@ -71,7 +71,7 @@ int platform_setup_device_caps(struct kernel_resources *kres)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setup capabilities for other uarts as free */
|
/* 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]->start = __pfn(PB926_UART1_BASE);
|
||||||
uart[1]->end = uart[1]->start + 1;
|
uart[1]->end = uart[1]->start + 1;
|
||||||
uart[1]->uattr = CAP_DEVTYPE_UART;
|
uart[1]->uattr = CAP_DEVTYPE_UART;
|
||||||
@@ -94,11 +94,13 @@ int platform_setup_device_caps(struct kernel_resources *kres)
|
|||||||
|
|
||||||
/* Setup timer1 capability as free */
|
/* Setup timer1 capability as free */
|
||||||
timer[1] = alloc_bootmem(sizeof(*timer[1]), 0);
|
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]->end = timer[1]->start + 1;
|
||||||
timer[1]->uattr = CAP_DEVTYPE_TIMER;
|
timer[1]->uattr = CAP_DEVTYPE_TIMER;
|
||||||
link_init(&timer[1]->list);
|
link_init(&timer[1]->list);
|
||||||
cap_list_insert(timer[1], &kres->devmem_free);
|
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 */
|
/* We will use UART0 for kernel as well as user tasks, so map it to kernel and user space */
|
||||||
|
|||||||
Reference in New Issue
Block a user