-- manually add dependencies for now (it would be better if each library
-- defined each own dependencies locally, but that does not seem to be an
-- easy thing to do currently
- libposixcompat_deps = LibDeps $ [ LibDep x | x <- deps ]
- where deps = ["vfsfd", "posixcompat"]
+ libposixcompat_deps = LibDeps [ LibDep "posixcompat", liblwip_deps,
+ libvfs_deps_all ]
liblwip_deps = LibDeps $ [ LibDep x | x <- deps ]
- where deps = ["lwip" ,"contmng" ,"procon" ,"timer" ,"hashtable"]
+ where deps = ["lwip" ,"contmng" ,"net_if_raw" ,"timer" ,"hashtable"]
libnetQmng_deps = LibDeps $ [ LibDep x | x <- deps ]
- where deps = ["net_queue_manager", "contmng" ,"procon" , "bfdmuxvm"]
+ where deps = ["net_queue_manager", "contmng" ,"procon" , "net_if_raw", "bfdmuxvm"]
- libnet_deps = LibDeps $ [liblwip_deps, libposixcompat_deps]
- libnfs_deps = LibDeps $ [ LibDep "nfs", libnet_deps]
+ libnfs_deps = LibDeps $ [ LibDep "nfs", liblwip_deps ]
-- we need to make vfs more modular to make this actually useful
- data VFSModules = VFS_RamFS | VFS_NFS
+ data VFSModules = VFS_RamFS | VFS_NFS | VFS_BlockdevFS | VFS_FAT
vfsdeps :: [VFSModules] -> [LibDepTree]
- vfsdeps [] = [LibDep "vfs"]
- vfsdeps (VFS_RamFS:xs) = [] ++ vfsdeps xs
- vfsdeps (VFS_NFS:xs) = [libnfs_deps] ++ vfsdeps xs
-
- libvfs_deps_all = LibDeps $ vfsdeps [VFS_NFS, VFS_RamFS]
- libvfs_deps_nfs = LibDeps $ vfsdeps [VFS_NFS]
- libvfs_deps_ramfs = LibDeps $ vfsdeps [VFS_RamFS]
+ vfsdeps [] = [LibDep "vfs"]
+ vfsdeps (VFS_RamFS:xs) = [] ++ vfsdeps xs
+ vfsdeps (VFS_NFS:xs) = [libnfs_deps] ++ vfsdeps xs
+ vfsdeps (VFS_BlockdevFS:xs) = [LibDep "ahci" ] ++ vfsdeps xs
+ vfsdeps (VFS_FAT:xs) = [] ++ vfsdeps xs
+
+ libvfs_deps_all = LibDeps $ vfsdeps [VFS_NFS, VFS_RamFS, VFS_BlockdevFS,
+ VFS_FAT]
+ libvfs_deps_nfs = LibDeps $ vfsdeps [VFS_NFS]
+ libvfs_deps_ramfs = LibDeps $ vfsdeps [VFS_RamFS]
+ libvfs_deps_blockdevfs = LibDeps $ vfsdeps [VFS_BlockdevFS]
+ libvfs_deps_fat = LibDeps $ vfsdeps [VFS_FAT, VFS_BlockdevFS]
-- flatten the dependency tree
flat :: [LibDepTree] -> [LibDepTree]
sbin/mem_serv_dist \
sbin/net-test \
sbin/netthroughput \
+ sbin/elb_app \
+ sbin/elb_app_tcp \
+ sbin/lo_queue \
sbin/pci \
+ sbin/acpi \
+ sbin/kaluga \
sbin/placement_bench \
sbin/phases_bench \
sbin/phases_scale_bench \
rpc get_cap(in uint32 idx, in uint32 cap_nr,
out errval err, out cap cap, out uint8 type);
- /* Kludge: retrieve frame cap to VBE BIOS */
+ /* Kludge: retrieve frame cap to VBE BIOS
rpc get_vbe_bios_cap(out errval err, out cap cap, out uint32 size);
-
- /* reset or sleep / power off machine */
rpc reset(out errval err);
- rpc sleep(in int state, out errval err);
+ rpc sleep(in int state, out errval err); */
+
+ /* read PCI conf header */
+ rpc read_conf_header(in uint32 dword, out errval err, out uint32 val);
+
+ /* write PCI conf header */
+ rpc write_conf_header(in uint32 dword, in uint32 val, out errval err);
};
errval_t pci_setup_inthandler(interrupt_handler_fn handler, void *handler_arg,
int *ret_vector);
- errval_t pci_reset(void);
- errval_t pci_sleep(int state);
-
- errval_t pci_get_vbe_bios_cap(struct capref *retcap, size_t *retsize);
+errval_t pci_read_conf_header(uint32_t dword, uint32_t *val);
+
+errval_t pci_write_conf_header(uint32_t dword, uint32_t val);
+
errval_t pci_client_connect(void);
#endif
--------------------------------------------------------------------------
[(let
- common_srcs = [ "bench.c" ]
+ common_srcs = [ "bench.c", "bench_ctl.c" ]
- arch_srcs "x86_32" = [ "arch/x86/bench_arch.c" ]
- arch_srcs "x86_64" = [ "arch/x86/bench_arch.c" ]
- arch_srcs "arm" = [ "arch/arm/bench_arch.c" ]
- arch_srcs _ = []
+ arch_srcs "x86_32" = [ "arch/x86/bench_arch.c" ]
+ arch_srcs "x86_64" = [ "arch/x86/bench_arch.c" ]
+ arch_srcs "arm" = [ "arch/arm/bench_arch.c" ]
+ arch_srcs _ = []
in
build library { target = "bench",
architectures = [arch],
/* sys_init() must be called before anthing else. */
void sys_init(void)
{
- /* assert(!"NYI"); */
+ // Nothing to do
}
- /*
- * sys_timeout():
- *
- * Schedule a timeout a specified amount of milliseconds in the
- * future. When the timeout occurs, the specified timeout handler will
- * be called. The handler will be passed the "arg" argument when
- * called.
- *
- */
- /*
- void sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
- {
- // add a timeout struct to the current thread's list
- struct sys_timeouts *timeouts = sys_arch_timeouts();
- struct sys_timeo *timeo;
-
- if (timeouts == NULL) {
- return;
- }
-
- timeo = (struct sys_timeo*) malloc(sizeof(struct sys_timeo));
- if (timeo == NULL) {
- return;
- }
-
- timeo->time = msecs;
- timeo->h = h;
- timeo->arg = arg;
-
- timeo->next = timeouts->next;
- timeouts->next = timeo;
-
- }*/
-
- /*
- void sys_untimeout(sys_timeout_handler h, void *arg)
- {
- // search the current thread's list and remove the entry
- struct sys_timeouts *timeouts = sys_arch_timeouts();
- struct sys_timeo *timeo, **prev;
-
- if (timeouts == NULL) {
- return;
- }
-
- prev = &timeouts->next;
- timeo = timeouts->next;
- while (timeo != NULL) {
- if (timeo->h == h && timeo->arg == arg) {
- *prev = timeo->next;
- break;
- }
- prev = &timeo->next;
- }
- } */
+
+
// from example in http://lwip.wikia.com/wiki/Porting_for_an_OS
struct sys_timeouts *sys_arch_timeouts(void) {
struct thread_wrapper *thread = lwip_system_threads;
free(sem);
}
- /*
- void sys_sem_wait(sys_sem_t sem)
- {
- sys_arch_sem_wait(sem, 0);
- } */
+
- /*
- int sys_sem_wait_timeout(sys_sem_t sem, u32_t timeout)
- {
- return sys_arch_sem_wait(sem, timeout);
- } */
+
- /* Time functions. */
- /*
- void sys_msleep(u32_t ms)
- {
- assert(!"NYI");
- }
- */
++
+
u32_t sys_jiffies(void)
{
/* since power up. */
return msgerr;
}
- errval_t pci_reset(void)
- {
- errval_t err, msgerr;
- err = pci_client->vtbl.reset(pci_client, &msgerr);
- return err_is_fail(err) ? err : msgerr;
- }
-
- errval_t pci_sleep(int state)
- {
- errval_t err, msgerr;
- err = pci_client->vtbl.sleep(pci_client, state, &msgerr);
- return err_is_fail(err) ? err : msgerr;
- }
-
- // Kludge for VBE driver
- errval_t pci_get_vbe_bios_cap(struct capref *retcap, size_t *retsize)
- {
- errval_t err, msgerr;
- assert(retcap != NULL);
- assert(retsize != NULL);
- uint32_t s;
- err = pci_client->vtbl.get_vbe_bios_cap(pci_client, &msgerr, retcap, &s);
- *retsize = s;
+ return err_is_fail(err) ? err : msgerr;
+}
+
+errval_t pci_read_conf_header(uint32_t dword, uint32_t *val)
+{
+ errval_t err, msgerr;
+ err = pci_client->vtbl.read_conf_header(pci_client, dword, &msgerr, val);
+ return err_is_fail(err) ? err : msgerr;
+}
+
+errval_t pci_write_conf_header(uint32_t dword, uint32_t val)
+{
+ errval_t err, msgerr;
+ err = pci_client->vtbl.write_conf_header(pci_client, dword, val, &msgerr);
- return err_is_fail(err) ? err : msgerr;
- }
-
static void bind_cont(void *st, errval_t err, struct pci_binding *b)
{
errval_t *reterr = st;
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <barrelfish/sys_debug.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "pci.h"
#include <if/pci_defs.h>
+ #include <acpi_client/acpi_client.h>
#include <mm/mm.h>
+#include "pci_confspace.h"
+ #include "pci.h"
#include "pci_debug.h"
-
/*****************************************************************
* Data types:
*****************************************************************/
err = b->tx_vtbl.get_vbe_bios_cap_response(b, NOP_CONT, SYS_ERR_OK, biosmem,
1UL << BIOS_BITS);
assert(err_is_ok(err));
- }
+ }*/
+static void read_conf_header_handler(struct pci_binding *b, uint32_t dword)
+{
+
+ struct client_state *cc = (struct client_state *) b->st;
+ struct pci_address addr = {
+ .bus= cc->bus,
+ .device=cc->dev,
+ .function=cc->fun,
+ };
+ PCI_DEBUG("Read config header from %u:%u:%u\n",addr.bus, addr.device, addr.function);
+ uint32_t val = pci_read_conf_header(&addr, dword);
+
+ errval_t err;
+ err = b->tx_vtbl.read_conf_header_response(b, NOP_CONT, SYS_ERR_OK, val);
+ assert(err_is_ok(err));
+}
+
+static void write_conf_header_handler(struct pci_binding *b, uint32_t dword, uint32_t val)
+{
+ struct client_state *cc = (struct client_state *) b->st;
+ struct pci_address addr = {
+ .bus= cc->bus,
+ .device=cc->dev,
+ .function=cc->fun,
+ };
+ PCI_DEBUG("Write config header from %u:%u:%u\n",addr.bus, addr.device, addr.function);
+ pci_write_conf_header(&addr, dword, val);
+
+ errval_t err;
+ err = b->tx_vtbl.write_conf_header_response(b, NOP_CONT, SYS_ERR_OK);
+ assert(err_is_ok(err));
+}
+
struct pci_rx_vtbl pci_rx_vtbl = {
.init_pci_device_call = init_pci_device_handler,
.init_legacy_device_call = init_legacy_device_handler,
.get_cap_call = get_cap_handler,
- .reset_call = reset_handler,
- .sleep_call = sleep_handler,
- .get_vbe_bios_cap_call = get_vbe_bios_cap,
+ //.get_vbe_bios_cap_call = get_vbe_bios_cap,
+ .read_conf_header_call = read_conf_header_handler,
+ .write_conf_header_call = write_conf_header_handler,
};
static void export_callback(void *st, errval_t err, iref_t iref)