OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [mm0/] [fs/] [bdev.c] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * This is just to allocate some memory as a block device.
3
 */
4
#include <init.h>
5
#include <l4/macros.h>
6
#include <bootdesc.h>
7
#include <memfs/memfs.h>
8
#include L4LIB_INC_ARCH(syslib.h)
9
 
10
void *vfs_rootdev_open(void)
11
{
12
        struct svc_image *rootfs_img = bootdesc_get_image_byname("rootfs");
13
        unsigned long rootfs_size = rootfs_img->phys_end - rootfs_img->phys_start;
14
 
15
        BUG_ON(rootfs_size < MEMFS_TOTAL_SIZE);
16
 
17
        /* Map filesystem blocks to virtual memory */
18
        return l4_map_helper((void *)rootfs_img->phys_start, __pfn(rootfs_size));
19
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.