Version 0.3.2-pre1
[fw/sdcc] / sim / ucsim / sim.src / hw.cc
index 210c807898670ed5a01dc79ad680354158979d50..ab0f5cfb39df2054bbf760fdc9f92af16047bb2e 100644 (file)
@@ -58,15 +58,15 @@ cl_hw::~cl_hw(void)
  * Callback functions for changing memory locations
  */
 
-ulong
-cl_hw::read(class cl_mem *mem, long addr)
+t_mem
+cl_hw::read(class cl_mem *mem, t_addr addr)
 {
   // Simply return the value
   return(mem->get(addr));
 }
 
 void
-cl_hw::write(class cl_mem *mem, long addr, ulong *val)
+cl_hw::write(class cl_mem *mem, t_addr addr, t_mem *val)
 {
   // Do not change *val by default
 }
@@ -89,4 +89,28 @@ cl_hw::print_info(class cl_console *con)
 }
 
 
+t_index
+cl_hws::add(void *item)
+{
+  int i;
+  t_index res;
+
+  // pre-add
+  for (i= 0; i < count; i++)
+    {
+      class cl_hw *hw= (class cl_hw *)(at(i));
+      hw->adding((class cl_hw *)item);
+    }
+  // add
+  res= cl_list::add(item);
+  // post-add
+  for (i= 0; i < count; i++)
+    {
+      class cl_hw *hw= (class cl_hw *)(at(i));
+      hw->added((class cl_hw *)item);
+    }
+  return(res);
+}
+
+
 /* End of hw.cc */