Merge branch coreboot.
authorGerd Zellweger <mail@gerdzellweger.com>
Wed, 15 Oct 2014 12:50:16 +0000 (14:50 +0200)
committerGerd Zellweger <mail@gerdzellweger.com>
Wed, 15 Oct 2014 12:50:16 +0000 (14:50 +0200)
Conflicts:
errors/errno.fugu
hake/menu.lst.x86_64
hake/symbolic_targets.mk
if/intermon.if
include/barrelfish/domain.h
include/barrelfish_kpi/dispatcher_shared.h
include/barrelfish_kpi/init.h
include/target/x86/barrelfish_kpi/coredata_target.h
include/trace/trace.h
kernel/Hakefile
kernel/arch/arm_gem5/paging.c
kernel/arch/armv7/syscall.c
kernel/arch/omap44xx/paging.c
kernel/arch/x86/init_ap_x86_64.S
kernel/arch/x86/syscall.c
kernel/arch/x86_32/start_aps.c
kernel/arch/x86_64/irq.c
kernel/capabilities.c
kernel/dispatch.c
kernel/include/arch/x86/start_aps.h
kernel/include/serial.h
kernel/schedule_rbed.c
kernel/startup.c
kernel/syscall.c
lib/bomp/bf_backend.c
lib/mdb/mdb_tree.c
lib/nfs/rpc.c
lib/posixcompat/inheritance.c
lib/posixcompat/select.c
lib/spawndomain/spawn.c
tools/debug.sh
usr/acpi/acpi_service.c
usr/drivers/e1000/e1000n.c
usr/kaluga/Hakefile
usr/monitor/spawn.c
usr/pci/pci.c
usr/pci/pci.h
usr/spawnd/bsp_bootup.c
usr/spawnd/main.c
usr/tests/nkm/modify_flags.c
usr/tests/testdesc/testdesc.c

61 files changed:
1  2 
errors/errno.fugu
hake/menu.lst.x86_64
hake/symbolic_targets.mk
if/intermon.if
if/pci.if
include/barrelfish/dispatch.h
include/barrelfish/domain.h
include/barrelfish/inthandler.h
include/barrelfish/spawn_client.h
include/barrelfish_kpi/dispatcher_shared.h
include/barrelfish_kpi/init.h
include/pci/pci.h
include/target/x86/barrelfish_kpi/coredata_target.h
include/trace/trace.h
kernel/Hakefile
kernel/arch/omap44xx/init.c
kernel/arch/x86/apic.c
kernel/arch/x86/startup_x86.c
kernel/arch/x86/syscall.c
kernel/arch/x86/timing.c
kernel/arch/x86_64/irq.c
kernel/arch/x86_64/startup_arch.c
kernel/arch/x86_64/syscall.c
kernel/capabilities.c
kernel/dispatch.c
kernel/include/arch/x86/start_aps.h
kernel/include/arch/x86/x86.h
kernel/include/serial.h
kernel/schedule_rbed.c
kernel/syscall.c
lib/barrelfish/arch/x86_64/dispatch.c
lib/barrelfish/domain.c
lib/barrelfish/inthandler.c
lib/barrelfish/spawn_client.c
lib/mdb/mdb_tree.c
lib/pci/pci_client.c
lib/posixcompat/sockets.c
lib/spawndomain/spawn.c
tools/asmoffsets/asmoffsets.c
trace_definitions/trace_defs.pleco
usr/acpi/acpi_service.c
usr/acpi/apic.c
usr/bfscope/bfscope.c
usr/drivers/e1000/e1000n.c
usr/kaluga/Hakefile
usr/kaluga/boot_modules.c
usr/kaluga/driver_startup.c
usr/kaluga/main.c
usr/kaluga/omap_startup.c
usr/kaluga/start_pci.c
usr/monitor/arch/x86/boot.c
usr/monitor/spawn.c
usr/pci/pci.c
usr/pci/pci.h
usr/pci/pci_service.c
usr/spawnd/Hakefile
usr/spawnd/main.c
usr/startd/main.c
usr/tests/mdbtests/test_range_query.c
usr/tests/net-test/net-test.c
usr/tests/testdesc/testdesc.c

index 5fd1230,c30d832..4145312
mode 100755,100644..100755
@@@ -575,15 -586,17 +585,17 @@@ errors spawn SPAWN_ERR_ 
      failure COPY_MODULECN       "Error copying module CNode cap",
      failure COPY_IRQ_CAP        "Error copying IRQ cap",
      failure COPY_IO_CAP         "Error copying IO cap",
-     failure COPY_PERF_MON    "Error copying performance monitoring cap",
 -    failure COPY_PERF_MON         "Error copying performance monitoring cap",
++    failure COPY_PERF_MON     "Error copying performance monitoring cap",
+     failure COPY_KERNEL_CAP     "Error copying Kernel cap",
+     failure COPY_INHERITCN_CAP  "Error copying capability from inherited cnode",
  
      // make_runnable
 -    failure DISPATCHER_SETUP  "Dispatcher setup",
 +    failure DISPATCHER_SETUP    "Dispatcher setup",
  
      // domain management
 -    failure DOMAIN_ALLOCATE   "No more domain descriptors",
 -    failure DOMAIN_NOTFOUND   "Domain not found",
 -    failure DOMAIN_RUNNING    "Domain is running",
 +    failure DOMAIN_ALLOCATE    "No more domain descriptors",
 +    failure DOMAIN_NOTFOUND    "Domain not found",
 +    failure DOMAIN_RUNNING    "Domain is running",
  };
  
  // errors from ELF library
@@@ -33,13 -33,10 +33,14 @@@ module /x86_64/sbin/routing_setup boo
  
  # Drivers
  module /x86_64/sbin/pci auto
+ module /x86_64/sbin/x86boot auto
  module /x86_64/sbin/ahcid auto
 +
 +## For networking
  module /x86_64/sbin/rtl8029 auto
  module /x86_64/sbin/e1000n auto
 +
 +## Other services needed for networking
  module /x86_64/sbin/NGD_mng auto
  module /x86_64/sbin/netd auto
  
@@@ -58,89 -63,13 +58,88 @@@ TESTS_COMMON= 
        sbin/schedtest \
        sbin/testerror \
        sbin/yield_test \
 +      sbin/fputest
 +
 +TESTS_x86_64= \
 +      sbin/mdbtest_range_query \
 +      sbin/mdbtest_addr_zero \
 +      sbin/ata_rw28_test \
 +      sbin/arrakis_hellotest \
 +      sbin/socketpipetest \
 +      sbin/spantest \
 +      sbin/testconcurrent \
 +      sbin/thcidctest \
 +      sbin/thcminitest \
 +      sbin/tweedtest \
 +      sbin/thctest \
 +      sbin/cxxtest \
 +      sbin/testdesc \
 +      sbin/testdesc-child \
 +      sbin/multihoptest \
 +      sbin/cryptotest \
 +      sbin/net-test \
        sbin/xcorecap \
 -      sbin/xcorecapserv \
 +      sbin/xcorecapserv
 +
 +
 +# All benchmark domains
 +BENCH_COMMON= \
 +      sbin/flounder_stubs_empty_bench \
 +      sbin/flounder_stubs_buffer_bench \
 +      sbin/flounder_stubs_payload_bench \
 +      sbin/channel_cost_bench \
        sbin/xcorecapbench \
 -    sbin/tracectrl \
 +      sbin/udp_throughput \
 +      sbin/ump_latency \
 +      sbin/ump_exchange \
 +      sbin/ump_latency_cache \
 +      sbin/ump_throughput \
 +      sbin/ump_send \
 +      sbin/ump_receive \
-       sbin/tlstest \
 +      sbin/timer_test \
 +      sbin/net_openport_test \
 +      sbin/perfmontest \
 +      sbin/thc_v_flounder_empty \
 +      sbin/multihop_latency_bench
 +
 +BENCH_x86_64= \
 +      sbin/bomp_benchmark_cg \
 +      sbin/bomp_benchmark_ft \
 +      sbin/bomp_benchmark_is \
 +      sbin/mdb_bench \
 +      sbin/mdb_bench_old \
 +      sbin/ahci_bench \
 +      sbin/apicdrift_bench \
 +      sbin/bulkbench \
 +      sbin/lrpc_bench \
 +      sbin/placement_bench \
 +      sbin/phases_bench \
 +      sbin/phases_scale_bench \
 +      sbin/shared_mem_clock_bench \
 +      $(BIN_RCCE_BT) \
 +      $(BIN_RCCE_LU) \
 +      sbin/tsc_bench \
 +      sbin/netthroughput \
 +      sbin/xomp_test_cpp \
 +      sbin/bulk_transfer_passthrough \
 +      sbin/bulkbench_micro_echo \
 +      sbin/bulkbench_micro_throughput \
 +      sbin/bulkbench_micro_rtt
 +
 +
 +GREEN_MARL= \
 +      sbin/gm_tc \
 +
 +# Default list of modules to build/install for all enabled architectures
 +MODULES_COMMON= \
 +      sbin/init_null \
 +      sbin/init \
 +      sbin/chips \
 +      sbin/spawnd \
 +      sbin/startd \
 +      sbin/mem_serv \
 +      sbin/monitor \
 +      sbin/ramfsd
  
  # List of modules that are arch-independent and always built
  MODULES_GENERIC= \
@@@ -196,32 -135,37 +195,34 @@@ MODULES_x86_64= 
        sbin/vbe \
        sbin/vmkitmon \
        sbin/webserver \
 -      sbin/tlstest \
 -      sbin/timer_test \
 -      sbin/net_openport_test \
 -      sbin/perfmontest \
        sbin/routing_setup \
 -      sbin/multihoptest \
 -      sbin/multihop_latency_bench \
 -      sbin/cryptotest \
        $(BIN_CONSENSUS) \
        sbin/bcached \
 -      sbin/testdesc \
 -      sbin/testdesc-child \
 -      sbin/lshw \
 +      sbin/spin \
 +      sbin/xeon_phi_mgr \
 +      sbin/xeon_phi \
 +      sbin/dma_mgr \
 +      sbin/ioat_dma \
 +      sbin/virtio_blk_host \
 +      sbin/virtio_blk \
 +      sbin/xeon_phi_inter \
 +      sbin/xeon_phi_test \
 +      sbin/dma_test \
 +      sbin/block_server \
 +      sbin/block_server_client \
 +      sbin/bs_user \
 +      sbin/bulk_shm \
+       sbin/x86boot \
  
 +MODULES_k1om= \
 +    sbin/weever \
 +      sbin/cpu \
 +      sbin/skb \
 +      sbin/xeon_phi \
 +      xeon_phi_multiboot \
 +      $(GREEN_MARL)
 +
  # the following are broken in the newidc system
  MODULES_x86_64_broken= \
        sbin/barriers \
diff --cc if/intermon.if
  
  interface intermon "The Interface between monitors" {
  
-         /* XXX Aliases for base system types */
-         alias coreid_t uint8;
-         alias chanid_t uint32;
-         
-         /* Types which we may need to change at some point, especially
-             on a heterogeneous platform, or 32-bit only platform */
-         alias con_id_t uint64;
-         alias mon_id_t uint64;
-         alias state_id_t uint64;
-         alias vci_t uint64;
-         alias capid_t uint32;
-         /* XXX depends on MAX_COREID and definition of coremask_t in types.h */
-         typedef uint64 coremask[4];
-         /* Struct to marshal caps between cores */
-         typedef struct {
-             uint64 w0;
-             uint64 w1;
-             uint64 w2;
-             uint64 w3;
-         } caprep;
-         message spawnd_image_request();
-         message spawnd_image_reply(genpaddr base, uint32 bytes);
-         message monitor_initialized();
-         message trace_caps_request();
-         message trace_caps_reply(caprep cap);
-         message mem_serv_iref_request();
-         message mem_serv_iref_reply(iref iref);
-         message ramfs_serv_iref_request();
-         message ramfs_serv_iref_reply(iref iref);
-         message name_serv_iref_request();
-         message name_serv_iref_reply(iref iref);
-         message monitor_mem_iref_request();
-         message monitor_mem_iref_reply(iref iref);
-         message bind_monitor_request(coreid_t core_id, caprep cap);
-         message bind_monitor_reply(errval err);
-         message bind_monitor_proxy(coreid_t dst_core_id, caprep cap);
-         message bind_monitor_request_scc(coreid_t core_id,
-                                          caprep cap,
-                                          chanid_t chan_id,
-                                          coreid_t from_core_id);
-         message bind_monitor_reply_scc(errval err,
-                                        chanid_t chan_id,
-                                        coreid_t core_id);
-         message bind_monitor_proxy_scc(coreid_t dst_core_id,
-                                        caprep cap,
-                                        chanid_t chan_id,
-                                        coreid_t core_id);
-         message new_monitor_notify(coreid_t core_id);
-         message bind_ump_request(iref iref,
-                                  mon_id_t mon_id,
-                                  uint32 channel_length_in,
-                                  uint32 channel_length_out,
-                                  genpaddr framebase,
-                                  uint8 framebits,
-                                  caprep notify);
-         message bind_ump_reply(con_id_t con_id,
-                                mon_id_t mon_id,
-                                errval err,
-                                caprep notify);
-         message cap_send_request(con_id_t con_id,
-                                  capid_t capid,
-                                  caprep cap,
-                                  errval err,
-                                  bool give_away,
-                                  bool has_descendents,
-                                  coremask on_cores,
-                                bool null_cap);
-         message span_domain_request(state_id_t state_id,
-                                     genpaddr vnodebase,
-                                     genpaddr framebase,
-                                     uint8      framebits);
-         message span_domain_reply(state_id_t state_id, errval err);
-       // Resource control
-       message rsrc_join(rsrcid id, coreid_t coreid);
-       message rsrc_join_complete(rsrcid id);
-       message rsrc_phase_data(rsrcid id, uint32 phase, uint8 data[len]);
-       message rsrc_timer_sync(uint64 timestamp);
-       message rsrc_timer_sync_reply(errval err);
-       // Change to given resource phase.
-       // timestamp is the time (as the scheduler counts it) when the
-       // message was sent, so other cores know what to relate
-       // relative timestamps to.
-       message rsrc_phase(rsrcid id, uint32 phase, uint64 timestamp);
-       
+     /* XXX Aliases for base system types */
+     alias coreid_t uint8;
+     alias chanid_t uint32;
+     /* Types which we may need to change at some point, especially
+         on a heterogeneous platform, or 32-bit only platform */
+     alias con_id_t uint64;
+     alias mon_id_t uint64;
+     alias state_id_t uint64;
+     alias vci_t uint64;
+     alias capid_t uint32;
+     /* XXX depends on MAX_COREID and definition of coremask_t in types.h */
+     typedef uint64 coremask[4];
+     /* Struct to marshal caps between cores */
+     typedef struct {
+         uint64 w0;
+         uint64 w1;
+         uint64 w2;
+         uint64 w3;
+     } caprep;
+     message spawnd_image_request();
+     message spawnd_image_reply(genpaddr base, uint32 bytes);
+     message trace_caps_request();
+     message trace_caps_reply(caprep cap);
+     message mem_serv_iref_request();
+     message mem_serv_iref_reply(iref iref);
+     message ramfs_serv_iref_request();
+     message ramfs_serv_iref_reply(iref iref);
+     message name_serv_iref_request();
+     message name_serv_iref_reply(iref iref);
+     message monitor_mem_iref_request();
+     message monitor_mem_iref_reply(iref iref);
+     /**
+      * New monitor communication set-up.
+      *  1. monitor_initialized (new monitor -> bsp)
+      *  2. new_monitor_nofity (monitor.0 -> <all available monitors>)
+      *  3. bind_monitor_proxy (<all available monitors> -> monitor.0)
+      *  4. bind_monitor_request (monitor.0 -> new monitor)
+      *  5. bind_monitor_reply (new monitor -> monitor.0)
+      */
+     message monitor_initialized();
+     message new_monitor_notify(coreid_t core_id);
+     message bind_monitor_proxy(coreid_t dst_core_id, caprep cap);
+     call bind_monitor_request(coreid_t core_id, caprep cap);
+     response bind_monitor_reply(errval err);
+     message bind_monitor_request_scc(coreid_t core_id,
+                                      caprep cap,
+                                      chanid_t chan_id,
+                                      coreid_t from_core_id);
+     message bind_monitor_reply_scc(errval err,
+                                    chanid_t chan_id,
+                                    coreid_t core_id);
+     message bind_monitor_proxy_scc(coreid_t dst_core_id,
+                                    caprep cap,
+                                    chanid_t chan_id,
+                                    coreid_t core_id);
 -
+     message bind_ump_request(iref iref,
+                              mon_id_t mon_id,
+                              uint32 channel_length_in,
+                              uint32 channel_length_out,
+                              genpaddr framebase,
+                              uint8 framebits,
+                              caprep notify);
+     message bind_ump_reply(con_id_t con_id,
+                            mon_id_t mon_id,
+                            errval err,
+                            caprep notify);
+     message cap_send_request(con_id_t con_id,
+                              capid_t capid,
+                              caprep cap,
+                              errval err,
+                              bool give_away,
+                              bool has_descendents,
+                              coremask on_cores,
+                              bool null_cap);
+     message span_domain_request(state_id_t state_id,
+                                 genpaddr vnodebase,
+                                 genpaddr framebase,
+                                 uint8      framebits);
+     message span_domain_reply(state_id_t state_id, errval err);
+     // Resource control
+     message rsrc_join(rsrcid id, coreid_t coreid);
+     message rsrc_join_complete(rsrcid id);
+     message rsrc_phase_data(rsrcid id, uint32 phase, uint8 data[len]);
+     message rsrc_timer_sync(uint64 timestamp);
+     message rsrc_timer_sync_reply(errval err);
+     // Change to given resource phase.
+     // timestamp is the time (as the scheduler counts it) when the
+     // message was sent, so other cores know what to relate
+     // relative timestamps to.
+     message rsrc_phase(rsrcid id, uint32 phase, uint64 timestamp);
      /* Multi-hop interconnect driver */
-       
      // request portion of routing table from another monitor
      call multihop_routing_table_request(coreid source_coreid);
      response multihop_routing_table_response(errval err,
diff --cc if/pci.if
Simple merge
Simple merge
@@@ -33,8 -31,7 +33,9 @@@ struct arrakis_rpc_client
  struct waitset *get_default_waitset(void);
  void disp_set_core_id(coreid_t core_id);
  coreid_t disp_get_core_id(void);
+ coreid_t disp_get_current_core_id(void);
 +void disp_get_eh_frame(lvaddr_t *eh_frame, size_t *eh_frame_size);
 +void disp_get_eh_frame_hdr(lvaddr_t *eh_frame_hdr, size_t *eh_frame_hdr_size);
  domainid_t disp_get_domain_id(void);
  coreid_t disp_handle_get_core_id(dispatcher_handle_t handle);
  void set_monitor_binding(struct monitor_binding *b);
Simple merge
Simple merge
@@@ -56,9 -56,7 +56,11 @@@ struct dispatcher_shared_generic 
      char        name[DISP_NAME_LEN];///< Name of domain, for debugging purposes
      uint32_t    fpu_used;               ///< Was FPU used while disabled?
      uint32_t    fpu_trap;               ///< State of FPU trap
++      
+     coreid_t    curr_core_id;  ///< Core id of current core, in this part so kernel can update
 +#ifdef __k1om__
 +    uint8_t     xeon_phi_id;
 +#endif
  };
  
  static inline struct dispatcher_shared_generic*
  #define TASKCN_SLOT_PERF_MON    14  ///< cap for performance monitoring
  #define TASKCN_SLOT_DISPFRAME2  15  ///< Copy of dispatcher frame cap (mapped into spawn vspace)
  #define TASKCN_SLOT_ARGSPAGE2   16  ///< Copy of environment cap (mapped into spawn vspace)
- #ifdef __k1om__
 -#define TASKCN_SLOT_COREBOOT    17  ///< Copy of realmode section used to bootstrap a core
 -#define TASKCN_SLOTS_USER       18  ///< First free slot in taskcn for user
 +#define TASKCN_SLOT_SYSMEM     17  ///< First free slot in taskcn for user
- #define TASKCN_SLOTS_USER       18  ///< First free slot in taskcn for user
- #else
- #define TASKCN_SLOTS_USER       17  ///< First free slot in taskcn for user
- #endif
++#define TASKCN_SLOT_COREBOOT    18  ///< Copy of realmode section used to bootstrap a core
++#define TASKCN_SLOTS_USER       19  ///< First free slot in taskcn for user
  /// Address bits resolved for the standard CNodes (taskcn, supercn, base_page_cn)
  #define DEFAULT_CN_ADDR_BITS    (CPTR_BITS - DEFAULT_CNODE_BITS)
  
@@@ -174,6 -167,6 +168,10 @@@ struct bootinfo 
      size_t              mem_spawn_core;
      /// Memory regions array
      struct mem_region   regions[];
++
++      /// For __k1om__
++    uint64_t host_msg;
++    uint8_t host_msg_bits;
  };
  
  #endif
Simple merge
@@@ -68,10 -68,9 +68,14 @@@ struct x86_core_data 
      uint32_t    start_free_ram;
  
      uint32_t    chan_id;
 -
++      
+     genpaddr_t kcb; ///< The kernel control block, this should fully replace x86_core_data at some point
 +#ifdef __k1om__
 +    struct xeon_phi_boot_params *bp;
 +    uint8_t  xeon_phi_id;
 +#endif
++
  #ifdef __scc__
      struct x86_coredata_modinfo    modinfo[10];
      struct x86_coredata_mmap       mmap[20];
Simple merge
diff --cc kernel/Hakefile
@@@ -46,23 -48,23 +48,23 @@@ le
               ++ (if Config.microbenchmarks then ["microbenchmarks.c"] else [])
               ++ (if Config.oneshot_timer then ["timer.c"] else [])
    common_libs = [ "getopt", "mdb_kernel" ]
-   
-   link_cpudriver arg = linkKernel opts name objs libs 
-     where 
+   link_cpudriver arg = linkKernel opts name objs libs
+     where
 -      opts = (kernelOptions $ head $ Args.architectures arg)
 +      opts = kernelOptions $ head $ Args.architectures arg
-       suffix = if "cpu" == Args.target arg 
-              then "" 
+       suffix = if "cpu" == Args.target arg
+              then ""
               else "_" ++ (Args.target arg)
        name = "cpu" ++ suffix
-       objs = [ objectFilePath opts f 
-              | f <- (Args.assemblyFiles arg) ++ (Args.cFiles arg) ++ common_c ] 
+       objs = [ objectFilePath opts f
+              | f <- (Args.assemblyFiles arg) ++ (Args.cFiles arg) ++ common_c ]
        libs = (Args.addLibraries arg) ++ common_libs
-     
-   cpudrivers arglist = 
-     let 
-       cafiles = Data.List.nub $ concat [ [ [ arch, cfile ] 
+   cpudrivers arglist =
+     let
+       cafiles = Data.List.nub $ concat [ [ [ arch, cfile ]
                                           | arch <- Args.architectures arg,
-                                                     cfile <- common_c ++ (Args.cFiles arg) ]
+                                            cfile <- common_c ++ (Args.cFiles arg) ]
                                         | arg <- arglist ]
        safiles = Data.List.nub $ concat [ [ [ arch, sfile ]
                                           | arch <- Args.architectures arg,
       addLibraries = [ "elf_kernel" ]
       },
    --
 +  -- Intel Xeon Phi (K1OM)
 +  --
 +  cpuDriver { 
 +     architectures = [ "k1om" ],
 +     assemblyFiles = [ "arch/k1om/boot.S",
 +                       "arch/k1om/entry.S", 
 +                       "arch/x86/init_ap_x86_64.S", 
 +                       "arch/x86/init_ap_x86_32.S" ],
 +     cFiles = [ "arch/k1om/debug.c", 
 +                "arch/k1om/gdb_arch.c", 
 +                "arch/k1om/init.c", 
 +                "arch/k1om/irq.c",
 +                "arch/k1om/startup_arch.c", 
 +                "arch/k1om/exec.c", 
 +                "arch/k1om/mcheck.c", 
 +                "arch/k1om/syscall.c", 
 +                "arch/k1om/paging.c",
 +                "arch/k1om/vmkit.c" , 
 +                "arch/k1om/page_mappings_arch.c",
 +                "arch/k1om/serial.c",
 +                "arch/k1om/xeon_phi.c",
 +                "arch/x86/apic.c", 
 +                "arch/x86/pic.c", 
 +                "arch/x86/start_aps.c", 
 +                "arch/x86/cmos.c", 
 +                "arch/x86/misc.c",
 +                "arch/x86/multiboot.c", 
 +                "arch/x86/conio.c", 
 +                "arch/x86/syscall.c", 
 +                "arch/x86/debugregs.c",
 +                "arch/x86/perfmon.c", 
 +                "arch/x86/perfmon_intel.c", 
 +                "arch/x86/perfmon_amd.c", 
 +                "arch/x86/rtc.c", 
 +                "arch/x86/timing.c",
 +                "arch/x86/startup_x86.c", 
 +                "arch/x86/ipi_notify.c"
 +              ],
 +     mackerelDevices = [ "lpc_pic", 
 +                         "pc16550d", 
 +                         "ia32", 
 +                         "amd64", 
 +                         "xapic", 
 +                         "amd_vmcb", 
 +                         "cpuid", 
 +                         "lpc_rtc", 
 +                         "xeon_phi/xeon_phi_serial" ],
 +     addLibraries = [ "elf_kernel" ] 
 +     },
 +
 +  --
    -- Generic Intel ia32 32-bit x86 core
    --
-   cpuDriver {         
+   cpuDriver {
       architectures = [ "x86_32" ],
-      assemblyFiles = [ "arch/x86_32/boot.S", 
-                        "arch/x86_32/entry.S", 
+      assemblyFiles = [ "arch/x86_32/boot.S",
+                        "arch/x86_32/entry.S",
                         "arch/x86_32/pic.S",
-                        "arch/x86/init_ap_x86_64.S", 
-                        "arch/x86/init_ap_x86_32.S" ],
-      cFiles = [ "arch/x86_32/debug.c", 
-                 "arch/x86_32/gdb_arch.c", 
-                 "arch/x86_32/init.c", 
+                        "arch/x86_32/init_ap_x86_32.S" ],
+      cFiles = [ "arch/x86_32/debug.c",
+                 "arch/x86_32/gdb_arch.c",
+                 "arch/x86_32/init.c",
                  "arch/x86_32/irq.c",
-                 "arch/x86_32/startup_arch.c", 
-                 "arch/x86_32/exec.c", 
-                 "arch/x86_32/syscall.c", 
+                 "arch/x86_32/startup_arch.c",
+                 "arch/x86_32/exec.c",
+                 "arch/x86_32/syscall.c",
                  "arch/x86_32/paging.c",
                  "arch/x86_32/page_mappings_arch.c",
-                 "arch/x86/apic.c", 
-                 "arch/x86/pic.c", 
-                 "arch/x86/start_aps.c", 
-                 "arch/x86/cmos.c", 
+                 "arch/x86_32/start_aps.c",
+                 "arch/x86/apic.c",
+                 "arch/x86/pic.c",
+                 "arch/x86/cmos.c",
                  "arch/x86/misc.c",
-                 "arch/x86/serial.c", 
-                 "arch/x86/multiboot.c", 
-                 "arch/x86/conio.c", 
-                 "arch/x86/syscall.c", 
+                 "arch/x86/serial.c",
+                 "arch/x86/multiboot.c",
+                 "arch/x86/conio.c",
+                 "arch/x86/syscall.c",
                  "arch/x86/debugregs.c",
-                 "arch/x86/perfmon.c", 
-                 "arch/x86/perfmon_intel.c", 
-                 "arch/x86/perfmon_amd.c", 
-                 "arch/x86/rtc.c", 
+                 "arch/x86/perfmon.c",
+                 "arch/x86/perfmon_intel.c",
+                 "arch/x86/perfmon_amd.c",
+                 "arch/x86/rtc.c",
                  "arch/x86/timing.c",
-                 "arch/x86/startup_x86.c", 
+                 "arch/x86/startup_x86.c",
                  "arch/x86/ipi_notify.c"
                ],
-      mackerelDevices = [ "lpc_pic", 
-                          "pc16550d", 
-                          "ia32", 
-                          "amd64", 
-                          "xapic", 
-                          "cpuid", 
+      mackerelDevices = [ "lpc_pic",
+                          "pc16550d",
+                          "ia32",
+                          "amd64",
+                          "xapic",
+                          "cpuid",
                           "lpc_rtc" ],
       addLibraries = [ "elf_kernel" ]
       },
       assemblyFiles = [ "arch/omap44xx/boot.S",
                         "arch/armv7/cp15.S",
                         "arch/armv7/exceptions.S" ],
-      cFiles = [ "arch/arm/exec.c", 
-                 "arch/arm/misc.c", 
-                 "arch/arm/exn.c", 
+      cFiles = [ "arch/arm/exec.c",
+                 "arch/arm/misc.c",
+                 "arch/arm/exn.c",
                  "arch/arm/phys_mmap.c",
                  "arch/armv7/gic.c",
-                 "arch/armv7/kludges.c", 
-                 "arch/armv7/multiboot.c", 
+                 "arch/armv7/kludges.c",
+                 "arch/armv7/multiboot.c",
 +                "arch/armv7/paging.c",
                  "arch/armv7/syscall.c",
                  "arch/armv7/irq.c",
-                 "arch/omap44xx/init.c", 
-                 "arch/omap44xx/omap.c", 
-                 "arch/omap44xx/paging.c", 
-                 "arch/omap44xx/startup_arch.c", 
-                 "arch/omap44xx/omap_uart.c", 
+                 "arch/omap44xx/init.c",
+                 "arch/omap44xx/omap.c",
+                 "arch/omap44xx/paging.c",
+                 "arch/omap44xx/startup_arch.c",
+                 "arch/omap44xx/omap_uart.c",
                  "arch/omap44xx/start_aps.c",
-                 "arch/omap44xx/spinlock.c", 
+                 "arch/omap44xx/spinlock.c",
                  "arch/omap44xx/cortexm3_heteropanda.c", --will be empty if heteropanda = False
                  "arch/armv7/kputchar.c"],
-      mackerelDevices = [ "arm", 
-                          "arm_icp_pit", 
-                          "pl130_gic", 
-                          "sp804_pit", 
-                          "cortex_a9_pit", 
+      mackerelDevices = [ "arm",
+                          "arm_icp_pit",
+                          "pl130_gic",
+                          "sp804_pit",
+                          "cortex_a9_pit",
 +                         "cortex_a9_gt",
-                          "a9scu", 
-                          "omap/omap_uart", 
-                          "omap/omap44xx_id", 
+                          "a9scu",
+                          "omap/omap_uart",
+                          "omap/omap44xx_id",
                           "omap/omap44xx_emif",
                           "omap/omap44xx_gpio",
                           "omap/omap44xx_sysctrl_padconf_core",
Simple merge
@@@ -440,3 -424,9 +440,9 @@@ xapic_esr_t apic_get_esr(void
      xapic_esr_rawwr(&apic, 0);
      return xapic_esr_rd(&apic);
  }
+ void apic_disable(void) {
+     ia32_apic_base_t apic_base_msr = ia32_apic_base_rd(NULL);
+     apic_base_msr = ia32_apic_base_global_insert(apic_base_msr, 0);
+     ia32_apic_base_wr(NULL, apic_base_msr);
 -}
++}
Simple merge
Simple merge
@@@ -312,17 -278,16 +312,20 @@@ void timing_calibrate(void
      } else {
  #ifndef __scc__
          if(apic_is_bsp()) {
 +#ifdef __k1om__
 +            tickspersec = calibrate_apic_timer_k1om();
 +#else
              tickspersec = calibrate_apic_timer_rtc();
 +#endif
              global->tickspersec = tickspersec;
+             tscperms = calibrate_tsc_apic_timer();
+             global->tscperms = tscperms;
          } else {
              tickspersec = global->tickspersec;
+             tscperms = global->tscperms;
          }
  
-         tscperms = calibrate_tsc_apic_timer();
  #else
          // SCC timer rate (we just know it)
          tickspersec = 400000000;     // XXX: APIC timer ticks faster than fits in a 32bit value
@@@ -384,6 -375,11 +375,7 @@@ bool kcb_sched_suspended = false
  #define TRACE_ETHERSRV_MODE 1
  #endif // CONFIG_TRACE && NETWORK_STACK_TRACE
  
 -#if CONFIG_TRACE && NETWORK_STACK_BENCHMARK
 -#define TRACE_N_BM 1
 -#endif // CONFIG_TRACE && NETWORK_STACK_BENCHMARK
 -
  /**
   * \brief Send interrupt notification to user-space listener.
   *
@@@ -405,19 -420,23 +416,13 @@@ static void send_user_interrupt(int irq
      }
  
      if (irq == 0) {
- //            printf("packet interrupt: %d: count %"PRIu32"\n", irq, pkt_interrupt_count);
 -//            printf("packet interrupt\n");
 -        ++interrupt_count;
 -#if TRACE_N_BM
 -#include<trace/trace.h>
 -    trace_event(TRACE_SUBSYS_BNET, TRACE_EVENT_BNET_I, interrupt_count);
 -#endif // TRACE_N_BM
 -/*
 -        if (interrupt_count >= 60){
 -            printf("interrupt number %"PRIu32"\n", interrupt_count);
 -        }
 -*/
 +        ++pkt_interrupt_count;
 +#if NETWORK_STACK_TRACE
 +    trace_event(TRACE_SUBSYS_NNET, TRACE_EVENT_NNET_UIRQ, pkt_interrupt_count);
 +#endif // NETWORK_STACK_TRACE
- /*
-         if (pkt_interrupt_count >= 60){
-             printf("interrupt number %"PRIu32"\n", pkt_interrupt_count);
-         }
- */
++
      }
--//    printf("Interrupt %d\n", irq);
      // Otherwise, cap needs to be an endpoint
 -    if (cap->type != ObjType_EndPoint) {
 -        printf("irq %d, cap->type == %d\n", irq, cap->type);
 -    }
      assert(cap->type == ObjType_EndPoint);
  
      // send empty message as notification
@@@ -801,27 -871,36 +857,36 @@@ update_kernel_now(void
  /// Handle an IRQ that arrived, either while in user or kernel mode (HLT)
  static __attribute__ ((used)) void handle_irq(int vector)
  {
-     debug(SUBSYS_DISPATCH, "IRQ vector %d while %s\n", vector,
+     int irq = vector - NEXCEPTIONS;
+     debug(SUBSYS_DISPATCH, "IRQ vector %d (irq %d) while %s\n", vector, irq,
            dcb_current ? (dcb_current->disabled ? "disabled": "enabled") : "in kernel");
  
-     int irq = vector - NEXCEPTIONS;
 -    /*static int counter = 0;
 -    if (counter++ % 10 == 0) {
 -        printf("%s:%s:%d: irq happened\n",
 -               __FILE__, __FUNCTION__, __LINE__);
 -    }*/
 -
  
      // if we were in wait_for_interrupt(), unmask timer before running userspace
      if (dcb_current == NULL && kernel_ticks_enabled) {
          apic_unmask_timer();
      }
  
 +#if TRACE_ETHERSRV_MODE
 +    trace_event(TRACE_SUBSYS_NNET, TRACE_EVENT_NNET_IRQ, vector);
 +#endif // TRACE_ETHERSRV_MODE
 +
      // APIC timer interrupt: handle in kernel and reschedule
      if (vector == APIC_TIMER_INTERRUPT_VECTOR) {
+         // count time slices
+         timer_fired ++;
 -        // switch kcb every 5 time slices (SG: I just picked 5 arbitrarily)
++
++        // switch kcb every other timeslice
+         if (!kcb_sched_suspended && timer_fired % 2 == 0 && kcb_current->next) {
+             //printk(LOG_NOTE, "switching from kcb(%p) to kcb(%p)\n", kcb_current, kcb_current->next);
+             switch_kcb(kcb_current->next);
+         }
++
          apic_eoi();
-       assert(kernel_ticks_enabled);
-       update_kernel_now();
-       trace_event(TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_TIMER, kernel_now);
-       wakeup_check(kernel_now);
 -        assert(kernel_ticks_enabled);
 -        update_kernel_now();
++          assert(kernel_ticks_enabled);
++          update_kernel_now();
+         trace_event(TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_TIMER, kernel_now);
+         wakeup_check(kernel_now+kcb_current->kernel_off);
      } else if (vector == APIC_PERFORMANCE_INTERRUPT_VECTOR) {
          // Handle performance counter overflow
          // Reset counters
              };
              strncpy(data.name, disp->name, PERFMON_DISP_NAME_LEN);
  
-                 // Call overflow handler represented by endpoint
+             // Call overflow handler represented by endpoint
              extern struct capability perfmon_callback_ep;
-           errval_t err;
-           size_t payload_len = sizeof(struct perfmon_overflow_data)/
-             sizeof(uintptr_t)+1;
-           err = lmp_deliver_payload(&perfmon_callback_ep,
-                                     NULL,
-                                     (uintptr_t*) &data,
-                                     payload_len,
-                                     false);
-                 // Make sure delivery was okay. SYS_ERR_LMP_BUF_OVERFLOW is okay for now
-                 assert(err_is_ok(err) || err_no(err)==SYS_ERR_LMP_BUF_OVERFLOW);
 -            errval_t err;
 -            size_t payload_len = sizeof(struct perfmon_overflow_data)/
 -                sizeof(uintptr_t)+1;
 -            err = lmp_deliver_payload(&perfmon_callback_ep,
 -                                      NULL,
 -                                      (uintptr_t*) &data,
 -                                      payload_len,
 -                                      false);
++            size_t payload_len = sizeof(struct perfmon_overflow_data)/ sizeof(uintptr_t)+1;
++              errval_t err = lmp_deliver_payload(&perfmon_callback_ep,
++                             NULL,
++                             (uintptr_t*) &data,
++                             payload_len,
++                             false);
+             // Make sure delivery was okay. SYS_ERR_LMP_BUF_OVERFLOW is okay for now
+             assert(err_is_ok(err) || err_no(err)==SYS_ERR_LMP_BUF_OVERFLOW);
          } else {
              // This should never happen, as interrupts are disabled in kernel
              printf("Performance counter overflow interrupt from "
Simple merge
Simple merge
Simple merge
@@@ -238,39 -242,23 +235,38 @@@ void __attribute__ ((noreturn)) dispatc
          dispatcher_get_disabled_save_area(handle);
  
      assert(disp != NULL);
-     disp->systime = kernel_now;
+     disp->systime = kernel_now + kcb_current->kernel_off;
 -
++      TRACE(KERNEL, SC_YIELD, 1);
++      
      if (dcb->disabled) {
          debug(SUBSYS_DISPATCH, "resume %.*s at 0x%" PRIx64 "\n", DISP_NAME_LEN,
                disp->name, (uint64_t)registers_get_ip(disabled_area));
          assert(dispatcher_is_disabled_ip(handle,
                                           registers_get_ip(disabled_area)));
- #if defined(__x86_64__) && !defined(__k1om__)
-       if(!dcb->is_vm_guest) {
-         resume(disabled_area);
 -        TRACE(KERNEL, SC_YIELD, 1);
 +
-       } else {
-         vmkit_vmenter(dcb);
-       }
++#if defined(__x86_64__) && !defined(__k1om__)
++        if(!dcb->is_vm_guest) {
++            resume(disabled_area);
++        } else {
++            vmkit_vmenter(dcb);
++        }
 +#else
-         resume(disabled_area);
+         resume(disabled_area);
 +#endif
      } else {
          debug(SUBSYS_DISPATCH, "dispatch %.*s\n", DISP_NAME_LEN, disp->name);
          assert(disp->dispatcher_run != 0);
          disp->disabled = 1;
- #if defined(__x86_64__) && !defined(__k1om__)
 -        TRACE(KERNEL, SC_YIELD, 1);
 +        if(!dcb->is_vm_guest) {
 +            execute(disp->dispatcher_run);
 +        } else {
 +            vmkit_vmexec(dcb, disp->dispatcher_run);
 +        }
 +#else
          execute(disp->dispatcher_run);
 +#endif
      }
 -}
 +} // end function: dispatch
  
  /**
   * \brief Transfer cap from 'send' to 'ep', according to 'msg'.
  #ifndef START_APS_H_
  #define START_APS_H_
  
+ #include <stdint.h>
+ #include <barrelfish_kpi/types.h>
  #define AP_STARTING_UP 1
  #define AP_STARTED     2
 -
+ #define STARTUP_TIMEOUT         0xffffff
  
- int start_aps_k1om_start(uint8_t core_id, genvaddr_t entry);
- int start_aps_x86_64_start(uint8_t core_id, genvaddr_t entry);
- int start_aps_x86_32_start(uint8_t core_id, genvaddr_t entry);
++int start_aps_k1om_start(coreid_t core_id, genvaddr_t entry);
+ int start_aps_x86_64_start(coreid_t core_id, genvaddr_t entry);
+ int start_aps_x86_32_start(coreid_t core_id, genvaddr_t entry);
  
  #endif // START_APS_H_
Simple merge
@@@ -27,13 -27,8 +27,13 @@@ extern const unsigned serial_num_physic
  /*
   * Initialize a physical serial port
   */
 +#ifdef __k1om__
 +extern errval_t serial_init(uintptr_t sbox_base);
 +extern errval_t serial_early_init(void);
 +#else
- extern errval_t serial_init(unsigned port);
+ extern errval_t serial_init(unsigned port, bool initialize_hw);
  extern errval_t serial_early_init(unsigned port);
 +#endif
  
  /*
   * Polled, blocking input/output.  No buffering.
@@@ -49,34 -40,12 +49,34 @@@ extern char serial_getchar(unsigned por
   * Console logical port.  Putchar will replace LF with CRLF, unlike
   * the above calls.
   */
 +#ifndef __k1om__
  extern unsigned serial_console_port;
 +#endif
 +
 +#ifdef __k1om__
 +static inline errval_t serial_console_init(lvaddr_t sbox_base)
 +{
 +    return serial_init(sbox_base);
 +}
 +
 +static inline void serial_console_putchar(char c)
 +{
 +    if (c == '\n') {
 +        serial_putchar('\r');
 +    }
 +    serial_putchar(c);
 +}
  
 +static inline char serial_console_getchar(void)
 +{
 +    return serial_getchar();
 +}
 +#else
- static inline errval_t serial_console_init(void)
+ static inline errval_t serial_console_init(bool hwinit)
  {
-     return serial_init(serial_console_port);
+     return serial_init(serial_console_port, hwinit);
  }
 +
  static inline void serial_console_putchar(char c)
  {
      if (c == '\n') {
@@@ -95,15 -62,12 +95,15 @@@ static inline char serial_console_getch
   * Debug logical port.  Putchar will replace LF with CRLF, unlike
   * the above calls.
   */
 +#ifndef __k1om__
  extern unsigned serial_debug_port;
  
 +
  static inline errval_t serial_debug_init(void)
  {
-     return serial_init(serial_debug_port);
+     return serial_init(serial_debug_port, true);
  }
 +
  static inline void serial_debug_putchar(char c)
  {
      if (c == '\n') {
@@@ -448,7 -455,7 +455,6 @@@ void make_runnable(struct dcb *dcb
          break;
  
      case TASK_TYPE_SOFT_REALTIME:
-         //        u_srt +=
 -        //      kcb_current->u_srt = u_srt +=
          panic("Unimplemented!");
          break;
  
@@@ -489,21 -496,7 +498,13 @@@ struct sysret sys_yield(capaddr_t targe
      // Remove from queue when no work and no more messages and no missed wakeup
      systime_t wakeup = disp->wakeup;
      if (!disp->haswork && disp->lmp_delivered == disp->lmp_seen
-         && (wakeup == 0 || wakeup > kernel_now)) {
+         && (wakeup == 0 || wakeup > (kernel_now + kcb_current->kernel_off))) {
 +
-          trace_event(TRACE_SUBSYS_NNET, TRACE_EVENT_NNET_SCHED_REMOVE,
++        trace_event(TRACE_SUBSYS_NNET, TRACE_EVENT_NNET_SCHED_REMOVE,
 +            (uint32_t)(lvaddr_t)dcb_current & 0xFFFFFFFF);
 +        trace_event(TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_SCHED_REMOVE,
 +                151);
 +
-     /*
-         if (disp->name[0] == 'e' && disp->name[1] == '1' ) {
-             printk(LOG_ERR, "%s has been removed from scheduler queue\n",
-                 disp->name);
-         }
- */
          scheduler_remove(dcb_current);
          if (wakeup != 0) {
              wakeup_set(dcb_current, wakeup);
Simple merge
Simple merge
Simple merge
@@@ -541,17 -389,9 +541,18 @@@ errval_t spawn_exit(uint8_t exitcode
  /**
   * \brief Wait for spawned proccess to exit on core.
   */
- errval_t spawn_wait_coreid(coreid_t coreid, domainid_t domainid, uint8_t *exitcode, bool nohang)
+ errval_t spawn_wait_coreid(coreid_t coreid, domainid_t domainid,
+                            uint8_t *exitcode, bool nohang)
  {
 +    return spawn_wait_core(disp_get_core_id(), domainid, exitcode, nohang);
 +}
 +
 +/**
 + * \brief Wait for the termination of a domain on a remote core.
 + */
 +errval_t spawn_wait_core(coreid_t coreid, domainid_t domainid,
 +                         uint8_t *exitcode, bool nohang)
 +{
      errval_t err, reterr;
  
      err = bind_client(coreid);
@@@ -303,12 -354,10 +354,11 @@@ mdb_skew(struct cte *node
          N(left)->right = node;
          mdb_update_end(node);
          mdb_update_end(left);
 +
          // need to update mdb_root
          if (mdb_root == node) {
-             mdb_root = left;
+             set_root(left);
          }
          return left;
      }
      else {
@@@ -346,12 -395,10 +396,11 @@@ mdb_split(struct cte *node
          N(right)->level += 1;
          mdb_update_end(node);
          mdb_update_end(right);
 +
          // need to update mdb_root
          if (mdb_root == node) {
-             mdb_root = right;
+             set_root(right);
          }
          return right;
      }
      else {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -26,16 -28,20 +28,21 @@@ extern bool mm_debug
  static void mm_alloc_range_proxy_handler(struct acpi_binding* b, uint8_t sizebits,
                                                 genpaddr_t minbase, genpaddr_t maxlimit)
  {
-     ACPI_DEBUG("mm_alloc_range_proxy_handler: sizebits: %d, minbase: 0x%lx maxlimit: 0x%lx\n",
 -    ACPI_DEBUG("mm_alloc_range_proxy_handler: sizebits: %d, "
++    ACPI_DEBUG("mm_alloc_range_proxy_handler: sizebits: %d, minbase: %lu maxlimit: %lu\n",
+                "minbase: 0x%"PRIxGENPADDR" maxlimit: 0x%"PRIxGENPADDR"\n",
 -               sizebits, minbase, maxlimit);
 +             sizebits, minbase, maxlimit);
  
+     //mm_debug = true;
      struct capref devframe = NULL_CAP;
 -    errval_t err = mm_alloc_range(&pci_mm_physaddr, sizebits, minbase, maxlimit, &devframe, NULL);
 +    /* errval_t err = mm_alloc_range(&pci_mm_physaddr, sizebits, minbase, maxlimit, &devframe, NULL); */
 +    errval_t err = mm_realloc_range(&pci_mm_physaddr, sizebits, minbase, &devframe);
      if (err_is_fail(err)) {
-       DEBUG_ERR(err, "mm realloc range failed...\n");
+       DEBUG_ERR(err, "mm alloc range failed...\n");
      }
  
+     //mm_debug = false;
      err = b->tx_vtbl.mm_alloc_range_proxy_response(b, NOP_CONT, devframe, err);
      assert(err_is_ok(err));
  }
diff --cc usr/acpi/apic.c
Simple merge
Simple merge
@@@ -1050,16 -998,16 +1003,18 @@@ int e1000n_driver_init(int argc, char *
      err = pci_client_connect();
      assert(err_is_ok(err));
  
 -    if (use_interrupt)
 +    if (use_interrupt) {
-         err = pci_register_driver_irq(e1000_init_fn, class, subclass, program_interface,
-                                       vendor, deviceid, bus, device, function,
-                                       e1000_interrupt_handler_fn, NULL);
+         err = pci_register_driver_movable_irq(e1000_init_fn, class, subclass, program_interface,
+                                               vendor, deviceid, bus, device, function,
+                                               e1000_interrupt_handler_fn, NULL,
+                                               e1000_reregister_handler,
+                                               NULL);
 -
 -    else
 +        printf("########### Driver with interrupts ###########\n");
 +    } else {
          err = pci_register_driver_noirq(e1000_init_fn, class, subclass, program_interface,
                                          vendor, deviceid, bus, device, function);
 +        printf("########### Driver without interrupts ###########\n");
 +    }
  
      if (err_is_fail(err)) {
          E1000_PRINT_ERROR("Error: %u, pci_register_driver failed\n", (unsigned int)err);
@@@ -16,7 -16,8 +16,8 @@@
                        flounderBindings = [ "octopus" ],
                        flounderExtraDefs = [ ("monitor_blocking",["rpcclient"]) ],
                        flounderTHCStubs = [ "octopus" ],
-                       addLibraries = libDeps [ "skb", "octopus", "vfs", 
-                                                "spawndomain", "elf", "mm", "lwip" ],
+                       addLibraries = libDeps [ "skb", "octopus", "vfs",
 -                                               "spawndomain", "elf", "mm",
++                                               "spawndomain", "elf", "mm" ],
+                                                "trace" ],
                        architectures = [ "x86_64", "x86_32", "armv7" ] }
  ]
Simple merge
  
  #include "kaluga.h"
  
- extern char **environ;
  #ifdef __x86__
 -errval_t default_start_function(coreid_t where, struct module_info* mi,
 -        char* record)
 +errval_t default_start_function(coreid_t where,
 +                                struct module_info* mi,
 +                                char* record)
  {
      assert(mi != NULL);
      errval_t err = SYS_ERR_OK;
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -48,27 -48,16 +48,38 @@@ static errval_t set_special_caps(struc
          }
      }
  
+     if (!strcmp(name, "kaluga")) {
+         src = cap_kernel;
+         dest.cnode = si->taskcn,
+         dest.slot  = TASKCN_SLOT_KERNELCAP;
+         err = cap_copy(dest, src);
+         if (err_is_fail(err)) {
+             DEBUG_ERR(err, "Can not give kernel cap to kaluga");
+             return err_push(err, SPAWN_ERR_COPY_KERNEL_CAP);
+         }
++      }
++
 +#ifdef __k1om__
 +    if (!strcmp(name, "xeon_phi")) {
 +        dest.cnode = si->taskcn;
 +        dest.slot  = TASKCN_SLOT_IO;
 +        src.cnode = cnode_task;
 +        src.slot  = TASKCN_SLOT_IO;
 +        err = cap_copy(dest, src);
 +        if (err_is_fail(err)) {
 +            return err_push(err, SPAWN_ERR_COPY_IRQ_CAP);
 +        }
 +
 +        dest.cnode = si->taskcn;
 +        dest.slot  = TASKCN_SLOT_SYSMEM;
 +        src.cnode = cnode_task;
 +        src.slot  = TASKCN_SLOT_SYSMEM;
 +        err = cap_copy(dest, src);
 +        if (err_is_fail(err)) {
 +            return err_push(err, SPAWN_ERR_COPY_IRQ_CAP);
 +        }
      }
 +#endif
  
      return SYS_ERR_OK;
  }
diff --cc usr/pci/pci.c
Simple merge
diff --cc usr/pci/pci.h
@@@ -60,7 -60,10 +60,11 @@@ errval_t device_init(bool enable_irq, u
                       uint32_t vendor_id, uint32_t device_id,
                       uint32_t *bus, uint32_t *dev,uint32_t *fun,
                       int *nr_allocated_bars);
+ errval_t device_reregister_interrupt(uint8_t coreid, int vector,
+                  uint32_t class_code, uint32_t sub_class, uint32_t prog_if,
+                  uint32_t vendor_id, uint32_t device_id, uint32_t *bus,
+                  uint32_t *dev,uint32_t *fun);
 +int pci_bar_to_caps_index(uint8_t bus, uint8_t dev, uint8_t fun, uint8_t BAR);
  int pci_get_nr_caps_for_bar(uint8_t bus, uint8_t dev, uint8_t fun, uint8_t index);
  struct capref pci_get_cap_for_device(uint8_t bus, uint8_t dev, uint8_t fun,
                                       uint8_t index, int cap_nr);
@@@ -282,12 -231,8 +297,13 @@@ 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,
+     .reregister_interrupt_call = reregister_interrupt_handler,
      //.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,
 +
 +    .msix_enable_call = msix_enable_handler,
 +    .msix_vector_init_call = msix_vector_init_handler,
  };
  
  static void export_callback(void *st, errval_t err, iref_t iref)
@@@ -11,9 -11,9 +11,9 @@@
  --------------------------------------------------------------------------
  
  [ build application { target = "spawnd",
-                     cFiles = [ "main.c", "bsp_bootup.c", "service.c", "ps.c" ],
+                     cFiles = [ "main.c", "service.c", "ps.c" ],
                      addLibraries = libDeps [ "spawndomain", "elf", "trace", "skb",
 -                                       "dist", "vfs" ],
 +                                       "dist", "vfs", "lwip" ],
                      flounderDefs = [ "monitor", "monitor_blocking" ],
                        flounderExtraDefs = [ ("monitor_blocking",["rpcclient"]) ],
                      flounderBindings = [ "spawn" ]
@@@ -103,11 -103,7 +103,11 @@@ int main(int argc, const char *argv[]
  {
      errval_t err;
  
 +    printf("Spawnd up.\n");
 +
 +
      vfs_init();
++    
      my_core_id = disp_get_core_id();
  
  
Simple merge
Simple merge
Simple merge
Simple merge