]> rtime.felk.cvut.cz Git - l4.git/commitdiff
update
authorl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Mon, 21 Feb 2011 18:06:59 +0000 (18:06 +0000)
committerl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Mon, 21 Feb 2011 18:06:59 +0000 (18:06 +0000)
git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@31 d050ee49-bd90-4346-b210-929a50b99cfc

17 files changed:
kernel/fiasco/src/jdb/jdb_attach_irq.cpp
kernel/fiasco/src/jdb/jdb_thread.cpp
kernel/fiasco/src/kern/arm/bsp/realview/board_check-arm-realview.cpp
kernel/fiasco/src/kern/arm/cpu-arm.cpp
kernel/fiasco/src/kern/arm/perf_cnt-arm.cpp
kernel/fiasco/src/kern/ipc_gate.cpp
kernel/fiasco/src/kern/ipi.cpp
kernel/fiasco/src/kern/irq.cpp
kernel/fiasco/src/kern/space.cpp
kernel/fiasco/src/kern/startup.cpp
kernel/fiasco/src/kern/static_init.h
kernel/fiasco/src/kern/uart_console.cpp
kernel/fiasco/src/templates/globalconfig.out.ia32-ndebug
kernel/fiasco/tool/checkinitcalls
l4/pkg/l4sys/include/scheduler.h
l4/pkg/libloader/lib/src/elf.cc
l4/pkg/shmc/lib/src/shmc.c

index 4f9cb52ab29c1e466459212eab282334ba27a17f..41a387f8a1aec06fb2a3b5eb577cc4bc2e162376 100644 (file)
@@ -17,7 +17,7 @@ IMPLEMENTATION:
 
 /**
  * 'IRQ' module.
- * 
+ *
  * This module handles the 'R' command that
  * provides IRQ attachment and listing functions.
  */
@@ -41,27 +41,27 @@ PUBLIC
 Jdb_module::Action_code
 Jdb_attach_irq::action( int cmd, void *&args, char const *&, int & )
 {
-  if (cmd!=0)
+  if (cmd)
     return NOTHING;
 
   if ((char*)args == &subcmd)
     {
-      switch(subcmd) 
-       {
-       case 'l': // list
-           {
-             Irq *r;
-             putchar('\n');
+      switch (subcmd)
+        {
+        case 'l': // list
+            {
+              Irq *r;
+              putchar('\n');
               for (unsigned i = 0; i < Config::Max_num_dirqs; ++i)
-               {
-                 r = static_cast<Irq*>(Irq_chip::hw_chip->irq(i));
-                 if (!r)
-                   continue;
-                 printf("IRQ %02x/%02d\n", i, i);
-               }
-           }
-         return NOTHING;
-       }
+                {
+                  r = static_cast<Irq*>(Irq_chip::hw_chip->irq(i));
+                  if (!r)
+                    continue;
+                  printf("IRQ %02x/%02d\n", i, i);
+                }
+              return NOTHING;
+            }
+        }
     }
   return NOTHING;
 }
@@ -98,7 +98,7 @@ class Jdb_kobject_irq : public Jdb_kobject_handler
 #define FIASCO_JDB_CMP_VTABLE(n, o) \
   extern char n[]; \
   char const *const *z = reinterpret_cast<char const* const*>(o); \
-  return *z == n + 12 ? (o) : 0
+  return *z == n + 3 * sizeof(Mword) ? (o) : 0
 
 
 PUBLIC static
index dd9212a8f0c25634a539ad0f989e987d01a5a298..3a09ea995f95445b8ca3f7952eb821e783c8dcd8 100644 (file)
@@ -75,7 +75,7 @@ PUBLIC static
 void
 Jdb_thread::print_partner(Thread *t, int task_format = 0)
 {
-  Kobject *o;
+  Sender *p = t->partner();
 
   if (!(t->state(false) & Thread_receiving))
     {
@@ -83,13 +83,13 @@ Jdb_thread::print_partner(Thread *t, int task_format = 0)
       return;
     }
 
-  if (!t->partner())
+  if (!p)
     {
       printf("%*s ", task_format, "-");
       return;
     }
 
-  if (Kobject_dbg::is_kobj(o = Kobject::pointer_to_obj(t->partner())))
+  if (Kobject *o = Kobject::pointer_to_obj(p))
     {
       char flag = '?';
       const char *n = o->kobj_type();
@@ -102,5 +102,5 @@ Jdb_thread::print_partner(Thread *t, int task_format = 0)
       printf("%*.lx%c", task_format, o->dbg_info()->dbg_id(), flag);
     }
   else
-    printf("\033[31;1m%p\033[m ", t->partner());
+    printf("\033[31;1m%p\033[m ", p);
 }
index 1dd90984c33b15c019c9feddfb912851cfd74b2d..829f30a8ec20d94ed78cc78bc7560eb53d201797 100644 (file)
@@ -9,36 +9,37 @@ public:
 
 private:
   static Mword read_board_id();
+  struct id_pair {
+    unsigned mask, id;
+  };
+  static id_pair ids[];
 };
 
 // ------------------------------------------------------------------------
-INTERFACE [arm && realview && realview_eb]:
+IMPLEMENTATION [arm && realview]:
 
-EXTENSION class Board_check
-{
-  enum {
-    id_mask = 0x1ffffe00, id_val = 0x01400400,
-  };
+#include "initcalls.h"
+
+// ------------------------------------------------------------------------
+IMPLEMENTATION [arm && realview && realview_eb]:
+
+Board_check::id_pair Board_check::ids[] FIASCO_INITDATA = {
+  { 0x1ffffe00, 0x01400400 },
 };
 
 // ------------------------------------------------------------------------
-INTERFACE [arm && realview && realview_pb11mp]:
+IMPLEMENTATION [arm && realview && realview_pb11mp]:
 
-EXTENSION class Board_check
-{
-  enum {
-    id_mask = 0x0fffff00, id_val = 0x0159f500,
-  };
+Board_check::id_pair Board_check::ids[] FIASCO_INITDATA = {
+  { 0x0fffff00, 0x0159f500 },
 };
 
 // ------------------------------------------------------------------------
-INTERFACE [arm && realview && realview_pbx]:
+IMPLEMENTATION [arm && realview && realview_pbx]:
 
-EXTENSION class Board_check
-{
-  enum {
-    id_mask = 0xffffff00, id_val = 0x1182f500,
-  };
+Board_check::id_pair Board_check::ids[] FIASCO_INITDATA = {
+  { 0xffffff00, 0x1182f500 }, // board
+  { 0xffffff00, 0x01780500 }, // qemu
 };
 
 // ------------------------------------------------------------------------
@@ -56,12 +57,12 @@ enum
   SYS_ID = Kmem::System_regs_map_base + 0x0,
 };
 
-IMPLEMENT static
+IMPLEMENT static FIASCO_INIT
 Mword
 Board_check::read_board_id()
 { return Io::read<Mword>(SYS_ID); }
 
-IMPLEMENT static
+IMPLEMENT static FIASCO_INIT
 void
 Board_check::check_board()
 {
@@ -71,14 +72,18 @@ Board_check::check_board()
          id >> 28, (id >> 16) & 0xfff, (id >> 12) & 0xf,
         (id >> 8) & 0xf, id & 0xff);
 
-  if ((id & id_mask) != id_val)
-    {
-      printf("  Invalid System ID for this kernel config\n"
-            "  Expected (%08lx & %08x) == %08x\n"
-            "  Stopping.\n", id, id_mask, id_val);
-      while (1)
-       Proc::halt();
-    }
+  for (unsigned i = 0; i < (sizeof(ids) / sizeof(ids[0])); ++i)
+    if ((id & ids[i].mask) == ids[i].id)
+      return;
+
+  printf("  Invalid System ID for this kernel config\n");
+  for (unsigned i = 0; i < (sizeof(ids) / sizeof(ids[0])); ++i)
+    printf("  Expected (%08lx & %08x) == %08x%s\n",
+           id, ids[i].mask, ids[i].id,
+           i + 1 < (sizeof(ids) / sizeof(ids[0])) ? ", or" : "");
+  printf("  Stopping.\n");
+  while (1)
+    Proc::halt();
 }
 
 STATIC_INITIALIZEX_P(Board_check, check_board, GDB_INIT_PRIO);
index d860118507f303806558a4b4a60f639b11d54d47..3ff1935699db6f42d2b777e77eefbb60c4345cae 100644 (file)
@@ -29,10 +29,26 @@ public:
 
   Cpu(unsigned id) { set_id(id); }
 
+
+  struct Ids {
+    Mword _pfr[2], _dfr0, _afr0, _mmfr[4];
+  };
+  void id_init();
+
+  enum {
+    Copro_dbg_model_not_supported = 0,
+    Copro_dbg_model_v6            = 2,
+    Copro_dbg_model_v6_1          = 3,
+    Copro_dbg_model_v7            = 4,
+  };
+
+  unsigned copro_dbg_model() const { return _cpu_id._dfr0 & 0xf; }
+
 private:
   static Cpu *_boot_cpu;
 
   unsigned _phys_id;
+  Ids _cpu_id;
 };
 
 // ------------------------------------------------------------------------
@@ -105,9 +121,8 @@ public:
   enum {
     Cp15_c1_ee              = 1 << 25,
     Cp15_c1_nmfi            = 1 << 27,
-    Cp15_c1_tre             = 1 << 28,
-    Cp15_c1_afe             = 1 << 29,
     Cp15_c1_te              = 1 << 30,
+    Cp15_c1_rao_sbop        = (0xf << 3) | (1 << 16) | (1 << 18) | (1 << 22) | (1 << 23),
 
     Cp15_c1_cache_bits      = Cp15_c1_cache
                               | Cp15_c1_insn_cache,
@@ -115,6 +130,7 @@ public:
     Cp15_c1_generic         = Cp15_c1_mmu
                               | (Config::Cp15_c1_use_alignment_check ?  Cp15_c1_alignment_check : 0)
                              | Cp15_c1_branch_predict
+                              | Cp15_c1_rao_sbop
                              | Cp15_c1_high_vector,
   };
 };
@@ -129,9 +145,8 @@ public:
     Cp15_c1_ha              = 1 << 17,
     Cp15_c1_ee              = 1 << 25,
     Cp15_c1_nmfi            = 1 << 27,
-    Cp15_c1_tre             = 1 << 28,
-    Cp15_c1_afe             = 1 << 29,
     Cp15_c1_te              = 1 << 30,
+    Cp15_c1_rao_sbop        = (0xf << 3) | (1 << 16) | (1 << 18) | (1 << 22) | (1 << 23),
 
     Cp15_c1_cache_bits      = Cp15_c1_cache
                               | Cp15_c1_insn_cache,
@@ -140,6 +155,7 @@ public:
                               | (Config::Cp15_c1_use_alignment_check ?  Cp15_c1_alignment_check : 0)
                              | Cp15_c1_branch_predict
                              | Cp15_c1_high_vector
+                              | Cp15_c1_rao_sbop
                              | (Config::Cp15_c1_use_a9_swp_enable ?  Cp15_c1_sw : 0),
 
     Smp_enable              = 0x41,
@@ -229,8 +245,6 @@ void Cpu::early_init()
   early_init_platform();
 
   Mem_unit::flush_cache();
-
-  print_infos();
 }
 
 
@@ -307,6 +321,36 @@ Cpu::init(bool is_boot_cpu)
   _phys_id = Proc::cpu_id();
 
   init_tz();
+
+  id_init();
+
+  print_infos();
+}
+
+//---------------------------------------------------------------------------
+IMPLEMENTATION [arm && !armv6plus]:
+
+IMPLEMENT
+void
+Cpu::id_init()
+{
+}
+
+//---------------------------------------------------------------------------
+IMPLEMENTATION [arm && armv6plus]:
+
+IMPLEMENT
+void
+Cpu::id_init()
+{
+  __asm__("mrc p15, 0, %0, c0, c1, 0": "=r" (_cpu_id._pfr[0]));
+  __asm__("mrc p15, 0, %0, c0, c1, 1": "=r" (_cpu_id._pfr[1]));
+  __asm__("mrc p15, 0, %0, c0, c1, 2": "=r" (_cpu_id._dfr0));
+  __asm__("mrc p15, 0, %0, c0, c1, 3": "=r" (_cpu_id._afr0));
+  __asm__("mrc p15, 0, %0, c0, c1, 4": "=r" (_cpu_id._mmfr[0]));
+  __asm__("mrc p15, 0, %0, c0, c1, 5": "=r" (_cpu_id._mmfr[1]));
+  __asm__("mrc p15, 0, %0, c0, c1, 6": "=r" (_cpu_id._mmfr[2]));
+  __asm__("mrc p15, 0, %0, c0, c1, 7": "=r" (_cpu_id._mmfr[3]));
 }
 
 //---------------------------------------------------------------------------
@@ -433,12 +477,39 @@ void
 Cpu::print_infos()
 {}
 
+// ------------------------------------------------------------------------
+IMPLEMENTATION [debug && armv6plus]:
+
+PRIVATE
+void
+Cpu::id_print_infos()
+{
+  printf("ID_PFR0:  %08lx\n", _cpu_id._pfr[0]);
+  printf("ID_PFR1:  %08lx\n", _cpu_id._pfr[1]);
+  printf("ID_DFR0:  %08lx\n", _cpu_id._dfr0);
+  printf("ID_AFR0:  %08lx\n", _cpu_id._afr0);
+  printf("ID_MMFR0: %08lx\n", _cpu_id._mmfr[0]);
+  printf("ID_MMFR1: %08lx\n", _cpu_id._mmfr[1]);
+  printf("ID_MMFR2: %08lx\n", _cpu_id._mmfr[2]);
+  printf("ID_MMFR3: %08lx\n", _cpu_id._mmfr[3]);
+}
+
+// ------------------------------------------------------------------------
+IMPLEMENTATION [debug && !armv6plus]:
+
+PRIVATE
+void
+Cpu::id_print_infos()
+{
+}
+
 // ------------------------------------------------------------------------
 IMPLEMENTATION [debug]:
 
-PRIVATE static
+PRIVATE
 void
 Cpu::print_infos()
 {
   printf("Cache config: %s\n", Config::cache_enabled ? "ON" : "OFF");
+  id_print_infos();
 }
index a52a093be34a72348eb25cf952008a1c03430733..cbb81d261fd6da5eb7c174c4fbd86fd04a8984e5 100644 (file)
@@ -286,13 +286,23 @@ Perf_cnt::mon_event_type(int nr)
 // ------------------------------------------------------------------------
 IMPLEMENTATION [arm && perf_cnt && (armca8 || armca9)]:
 
+#include "cpu.h"
+
 char const *Perf_cnt::perf_type_str = "ACor";
 int Perf_cnt::_nr_counters;
 
+PRIVATE static
+bool
+Perf_cnt::is_avail()
+{ return Cpu::boot_cpu()->copro_dbg_model() == Cpu::Copro_dbg_model_v7; }
+
 PRIVATE static
 void
 Perf_cnt::set_event_type(int counter_nr, int event)
 {
+  if (!is_avail())
+    return;
+
   pmnxsel(counter_nr);
   evtsel(event);
 }
@@ -301,6 +311,8 @@ PUBLIC static
 Mword
 Perf_cnt::read_cycle_cnt()
 {
+  if (!is_avail())
+    return 0;
   return ccnt();
 }
 
@@ -308,17 +320,21 @@ PUBLIC static
 unsigned long
 Perf_cnt::read_counter(int counter_nr)
 {
+  if (!is_avail())
+    return 0;
   if (counter_nr >= _nr_counters)
     return ccnt();
   pmnxsel(counter_nr);
   return pmcnt();
 }
 
-
 PUBLIC static
 unsigned
 Perf_cnt::mon_event_type(int nr)
 {
+  if (!is_avail())
+    return 0;
+
   if (nr >= _nr_counters)
     return 0xff;
   pmnxsel(nr);
@@ -329,6 +345,9 @@ PUBLIC static FIASCO_INIT_CPU
 void
 Perf_cnt::init_cpu()
 {
+  if (!is_avail())
+    return;
+
   _nr_counters = (pmnc() >> 11) & 0x1f;
 
   pmnc(PMNC_ENABLE | PMNC_PERF_RESET | PMNC_CNT_RESET);
@@ -341,8 +360,6 @@ Perf_cnt::init_cpu()
   useren(1);
 }
 
-
-
 // ------------------------------------------------------------------------
 IMPLEMENTATION [arm && perf_cnt]:
 
index df4da3b1ff55d18ee0f0cf70635e78fdd8abf87f..5dc2dc87247ba1e5be131639465cd18d2d9be563 100644 (file)
@@ -12,6 +12,12 @@ class Ipc_gate_obj;
 
 class Ipc_gate_ctl : public Kobject_h<Ipc_gate_ctl, Kobject_iface>
 {
+private:
+  enum Operation
+  {
+    Op_bind     = 0x10,
+    Op_get_info = 0x11,
+  };
 };
 
 class Ipc_gate : public Kobject
@@ -255,9 +261,9 @@ Ipc_gate_ctl::kinvoke(L4_obj_ref self, Mword rights, Syscall_frame *f, Utcb cons
 
   switch (in->values[0])
     {
-    case 0x10:
+    case Op_bind:
       return bind_thread(self, rights, f, in, out);
-    case 0x11:
+    case Op_get_info:
       return get_infos(self, rights, f, in, out);
     default:
       return static_cast<Ipc_gate_obj*>(this)->kobject_invoke(self, rights, f, in, out);
index f13ea86542ee4561169699d1de4558d9d6f4c0fb..b770d513dd5fd62f615c72dcec7f9722c3ed7318 100644 (file)
@@ -16,6 +16,7 @@ public:
 
 INTERFACE[mp]:
 
+#include "per_cpu_data.h"
 #include "spin_lock.h"
 
 EXTENSION class Ipi
@@ -27,8 +28,6 @@ private:
 
 INTERFACE[mp && debug]:
 
-#include "per_cpu_data.h"
-
 EXTENSION class Ipi
 {
 public:
index 0a2a3ee18ee017c0b72a98574efd872d08980c75..5a55192bfcadcab433529345f355451fac425176 100644 (file)
@@ -59,6 +59,9 @@ class Irq_sender
 : public Kobject_h<Irq_sender, Irq>,
   public Ipc_sender<Irq_sender>
 {
+public:
+  Mword kobject_size() const { return sizeof(*this); }
+
 private:
   Irq_sender(Irq_sender &);
 
index 37af0cde857e0f387f3f59c1be9c13411cb25e28..91659d2b4fe2320cd26331169fd5fe418cca73b5 100644 (file)
@@ -22,6 +22,7 @@ INTERFACE:
 #include "obj_space.h"
 #include "spin_lock.h"
 #include "ref_obj.h"
+#include "slab_cache_anon.h"
 
 class Ram_quota;
 class Context;
index 605d6ca6ac9f39f02f7cc943e7e9ffb5e061f600..d3cf2400d77e69ea25ca706f9a5ab6933bc968ef 100644 (file)
@@ -10,7 +10,6 @@ public:
 
   // startup code that runs after console I/O is initialized
   static void stage2();
-  
 };
 
 IMPLEMENTATION:
index f3f3b0ca888ea940cd659b29259bbd12b58565b0..15f9bab87ed5ba3bb34f720635294fee85e7422d 100644 (file)
@@ -83,7 +83,7 @@ static static_init_##va __static_construction_of_##va##__ \
 #define STATIC_INITIALIZER_P(f, p) \
   __STATIC_INITIALIZER_P(f,func_##f,p)
 
-/// mark f as static initailizer 
+/// mark f as static initailizer
 #define STATIC_INITIALIZER(f) \
   __STATIC_INITIALIZER(f,func_##f)
 //@}
@@ -91,12 +91,12 @@ static static_init_##va __static_construction_of_##va##__ \
 
 /// static initialization of singleton (static) classes
 /**
- * The classes that should be initialized must provide 
+ * The classes that should be initialized must provide
  * a init() member function that takes no arguments.
  */
 //@{
 
-/** mark class c to be statically initialized via its init 
+/** mark class c to be statically initialized via its init
  *  function and with priority p
  */
 #define STATIC_INITIALIZE_P(c,p) \
@@ -106,7 +106,7 @@ static static_init_##va __static_construction_of_##va##__ \
 #define STATIC_INITIALIZE(c) \
   __STATIC_INITIALIZER(c::init, class_##c)
 
-/** mark class c to be statically initialized via its init 
+/** mark class c to be statically initialized via its init
  *  function and with priority p
  */
 #define STATIC_INITIALIZEX_P(c,func,p) \
index bc2f886f029b71136a1d04608a4a8b14df526cc9..c0379e70230d29a28454ecc6c5265eb932a34eb8 100644 (file)
@@ -11,7 +11,7 @@ IMPLEMENTATION:
 #include "static_init.h"
 #include "irq.h"
 
-STATIC_INITIALIZER_P(uart_console_init_stage1 ,UART_INIT_PRIO);
+STATIC_INITIALIZER_P(uart_console_init_stage1UART_INIT_PRIO);
 STATIC_INITIALIZER  (uart_console_init_stage2);
 
 static void uart_console_init_stage1()
index c9af76d6a76a2bbcea47d57e4838e390900c7b78..c8de146e6c46d345d17cbd259961ec4ed90d05a8 100644 (file)
@@ -58,12 +58,7 @@ CONFIG_NO_FRAME_PTR=y
 # CONFIG_IRQ_SPINNER is not set
 CONFIG_WATCHDOG=y
 CONFIG_SERIAL=y
-CONFIG_JDB=y
-# CONFIG_JDB_LOGGING is not set
-CONFIG_JDB_DISASM=y
-CONFIG_JDB_GZIP=y
-# CONFIG_JDB_ACCOUNTING is not set
-# CONFIG_JDB_MISC is not set
+# CONFIG_JDB is not set
 CONFIG_POWERSAVE_GETCHAR=y
 # CONFIG_WARN_NONE is not set
 CONFIG_WARN_WARNING=y
@@ -80,7 +75,6 @@ CONFIG_HOST_CXX="g++"
 # CONFIG_MAINTAINER_MODE is not set
 CONFIG_LABEL=""
 CONFIG_EXPERIMENTAL=y
-CONFIG_PERF_CNT=y
 CONFIG_BIT32=y
 CONFIG_WARN_LEVEL=1
 CONFIG_XARCH="ia32"
index 6948cdebeff0cbf36bd50d0ec9b4372174ddee1b..f2d8f06f964f8c5331a24afde3a10304cebf922f 100755 (executable)
@@ -52,8 +52,9 @@ $sym_objdump = $target.$sym_objdump;
 
 $werror = 1 if have_warn_opt("error");
 if (!have_warn_opt("static-construction")) {
-  push @ignore_funcs, ("__static_initialization_and_destruction_0");
-  push @ignore_funcs, ("_GLOBAL__I\\.\\S*");
+  push @ignore_funcs, ("(_Z41)?__static_initialization_and_destruction_0(ii\\.clone\\.\\d+)?");
+  push @ignore_funcs, ("_GLOBAL__(sub_)?I\\.\\S*");
+  push @ignore_funcs, ("_GLOBAL__sub_I__Z\\S*");
   push @ignore_funcs, ("global constructors keyed to \\S*");
   push @ignore_funcs, ("T\\.\\d+");
 }
index e2384776d1ec095b7b8de584e1feecafdf409638..555937c175b9c937d8577b89017e9821c396f2d7 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 /**
- * \brief
+ * \brief CPU sets.
  * \ingroup l4_scheduler_api
  */
 typedef struct l4_sched_cpu_set_t
@@ -95,30 +95,18 @@ l4_scheduler_info_u(l4_cap_idx_t scheduler, l4_umword_t *cpu_max,
 
 
 /**
- * \brief
+ * \brief Scheduler parameter set.
  * \ingroup l4_scheduler_api
  */
 typedef struct l4_sched_param_t
 {
-  /**
-   * Timeslice in micro seconds.
-   */
-  l4_cpu_time_t quantum;
-
-  /**
-   * Priority for scheduling.
-   */
-  unsigned prio;
-
-  /**
-   * CPU affinity.
-   */
-  l4_sched_cpu_set_t affinity;
-
+  l4_cpu_time_t      quantum;  ///< Timeslice in micro seconds.
+  unsigned           prio;     ///< Priority for scheduling.
+  l4_sched_cpu_set_t affinity; ///< CPU affinity.
 } l4_sched_param_t;
 
 /**
- * \brief
+ * \brief Construct scheduler parameter.
  * \ingroup l4_scheduler_api
  */
 L4_INLINE l4_sched_param_t
index 762a583c98807169111660acb29400fc29ac55b6..48b57b45cfb47d78b26c5666a7ae6bae6a8df53e 100644 (file)
@@ -20,6 +20,7 @@ char const *Ldr::Elf_phdr::phdr_type() const
     {
     case PT_L4_STACK: return "L4_STACK";
     case PT_L4_KIP:   return "L4_KIP";
+    case PT_L4_AUX:   return "L4_AUX";
     case PT_GNU_EH_FRAME: return "GNU_EH_FRAME";
     case PT_GNU_STACK:    return "GNU_STACK";
     case PT_GNU_RELRO:    return "GNU_RELRO";
index 6ff84d52be140993de7090571845b4ed399d6ad5..71f9c5bb6949d572fc80f5c9e17e8fb4e6cadd01 100644 (file)
@@ -48,42 +48,37 @@ l4shmc_create(const char *shm_name, l4_umword_t shm_size)
 {
   shared_mem_t *s;
   l4re_ds_t shm_ds = L4_INVALID_CAP;
-  l4re_namespace_t tmp = L4_INVALID_CAP;
+  l4re_namespace_t shm_cap;
   long r = -L4_ENOMEM;
 
+  shm_cap = l4re_get_env_cap(shm_name);
+  if (l4_is_invalid_cap(shm_cap))
+    return -L4_ENOENT;
+
   if (l4_is_invalid_cap(shm_ds = l4re_util_cap_alloc()))
-    goto out;
+    return -L4_ENOMEM;
 
   if ((r = l4re_ma_alloc(shm_size, shm_ds, 0)))
-    goto out;
+    goto out_shm_free_cap;
 
   if ((r = l4re_rm_attach((void **)&s, shm_size, L4RE_RM_SEARCH_ADDR, shm_ds,
                           0, L4_PAGESHIFT)))
-    goto out;
+    goto out_shm_free_mem;
 
   s->_first_chunk = 0;
 
-  r =  -L4_ENOMEM;
-  if (l4_is_invalid_cap(tmp = l4re_util_cap_alloc()))
-    goto out;
-
-  tmp = l4re_get_env_cap(shm_name);
-  if (l4_is_invalid_cap(tmp))
-    {
-      r = -L4_ENOENT;
-      goto out;
-    }
-
-  if ((r = l4re_ns_register_obj_srv(tmp, "shm", shm_ds, L4RE_NS_REGISTER_RW)))
-    goto out;
+  r = L4_EOK;
+  if ((r = l4re_ns_register_obj_srv(shm_cap, "shm", shm_ds, L4RE_NS_REGISTER_RW)))
+    r = -L4_EINVAL;
 
   l4re_rm_detach_unmap((l4_addr_t)s, L4RE_THIS_TASK_CAP);
 
-  r = L4_EOK;
+  return r;
 
-out:
-  if (!l4_is_invalid_cap(tmp))
-    l4re_util_cap_free(tmp);
+out_shm_free_mem:
+  l4re_ma_free(shm_ds);
+out_shm_free_cap:
+  l4re_util_cap_free(shm_ds);
   return r;
 }
 
@@ -286,7 +281,6 @@ l4shmc_attach_signal_to(l4shmc_area_t *shmarea,
              r, signal->_sigcap, l4_debugger_global_id(signal->_sigcap),
              thread);
       l4re_util_cap_free(signal->_sigcap);
-      goto out;
     }
 
 out: