Esempio n. 1
0
 def Remove(self, ctx):
   node_addr = ctx.cpu.r_reg(REG_A1)
   n = AccessStruct(ctx.mem, NodeDef, node_addr)
   succ = n.r_s("ln_Succ")
   pred = n.r_s("ln_Pred")
   log_exec.info("Remove(%06x): ln_Pred=%06x ln_Succ=%06x" % (node_addr, pred, succ))
   AccessStruct(ctx.mem, NodeDef, pred).w_s("ln_Succ", succ)
   AccessStruct(ctx.mem, NodeDef, succ).w_s("ln_Pred", pred)
   return node_addr
Esempio n. 2
0
 def AddHead(self, ctx):
     list_addr = ctx.cpu.r_reg(REG_A0)
     node_addr = ctx.cpu.r_reg(REG_A1)
     log_exec.info("AddHead(%06x, %06x)" % (list_addr, node_addr))
     l = AccessStruct(ctx.mem, ListDef, list_addr)
     n = AccessStruct(ctx.mem, NodeDef, node_addr)
     n.w_s("ln_Pred", l.s_get_addr("lh_Head"))
     h = l.r_s("lh_Head")
     n.w_s("ln_Succ", h)
     AccessStruct(ctx.mem, NodeDef, h).w_s("ln_Pred", node_addr)
     l.w_s("lh_Head", node_addr)
Esempio n. 3
0
 def RemTail(self, ctx):
     list_addr = ctx.cpu.r_reg(REG_A0)
     l = AccessStruct(ctx.mem, ListDef, list_addr)
     node_addr = l.r_s("lh_TailPred")
     n = AccessStruct(ctx.mem, NodeDef, node_addr)
     succ = n.r_s("ln_Succ")
     pred = n.r_s("ln_Pred")
     if pred == 0:
         log_exec.info("RemTail(%06x): null" % list_addr)
         return 0
     AccessStruct(ctx.mem, NodeDef, pred).w_s("ln_Succ", succ)
     AccessStruct(ctx.mem, NodeDef, succ).w_s("ln_Pred", pred)
     log_exec.info("RemTail(%06x): %06x" % (list_addr, node_addr))
     return node_addr
Esempio n. 4
0
 def AddSemaphore(self, ctx):
     addr = ctx.cpu.r_reg(REG_A1)
     sstruct = AccessStruct(ctx.mem, SignalSemaphoreDef, addr)
     name_ptr = sstruct.r_s("ss_Link.ln_Name")
     name = ctx.mem.access.r_cstr(name_ptr)
     self.semaphore_mgr.AddSemaphore(addr, name)
     log_exec.info("AddSemaphore(%06x,%s)" % (addr, name))
Esempio n. 5
0
 def DateToStr(self, ctx):
     dt_ptr = ctx.cpu.r_reg(REG_D1)
     dt = AccessStruct(ctx.mem, DateTimeDef, struct_addr=dt_ptr)
     ds_day = dt.r_s("dat_Stamp.ds_Days")
     ds_min = dt.r_s("dat_Stamp.ds_Minute")
     ds_tick = dt.r_s("dat_Stamp.ds_Tick")
     format = dt.r_s("dat_Format")
     flags = dt.r_s("dat_Flags")
     str_day_ptr = dt.r_s("dat_StrDay")
     str_date_ptr = dt.r_s("dat_StrDate")
     str_time_ptr = dt.r_s("dat_StrTime")
     at = AmiTime(ds_day, ds_min, ds_tick)
     st = at.to_sys_time()
     log_dos.info("DateToStr: ptr=%06x format=%x flags=%x day_ptr=%06x date_ptr=%06x time_ptr=%06x %s => sys_time=%d", \
       dt_ptr, format, flags, str_day_ptr, str_date_ptr, str_time_ptr, at, st)
     t = time.gmtime(st)
     day_str = time.strftime("%A", t)
     date_str = time.strftime("%d-%m-%y", t)
     time_str = time.strftime("%H:%M:%S", t)
     log_dos.info("DateToStr: result day='%s' date='%s' time='%s'", day_str,
                  date_str, time_str)
     if str_day_ptr != 0:
         ctx.mem.access.w_cstr(str_day_ptr, day_str)
     if str_date_ptr != 0:
         ctx.mem.access.w_cstr(str_date_ptr, date_str)
     if str_time_ptr != 0:
         ctx.mem.access.w_cstr(str_time_ptr, time_str)
     return self.DOSTRUE
Esempio n. 6
0
 def StackSwap(self, ctx):
     stsw_ptr = ctx.cpu.r_reg(REG_A0)
     stsw = AccessStruct(ctx.mem, StackSwapDef, struct_addr=stsw_ptr)
     # get new stack values
     new_lower = stsw.r_s('stk_Lower')
     new_upper = stsw.r_s('stk_Upper')
     new_pointer = stsw.r_s('stk_Pointer')
     # retrieve current (old) stack
     old_lower = self.stk_lower
     old_upper = self.stk_upper
     old_pointer = ctx.cpu.r_reg(REG_A7)  # addr of sys call return
     # get adress of callee
     callee = ctx.mem.access.r32(old_pointer)
     # is a label attached to new addr
     label = ctx.label_mgr.get_label(new_lower)
     if label is not None:
         label.name = label.name + "=Stack"
     # we report the old stack befor callee
     old_pointer += 4
     log_exec.info(
         "StackSwap: old(lower=%06x,upper=%06x,ptr=%06x) new(lower=%06x,upper=%06x,ptr=%06x)"
         % (old_lower, old_upper, old_pointer, new_lower, new_upper,
            new_pointer))
     stsw.w_s('stk_Lower', old_lower)
     stsw.w_s('stk_Upper', old_upper)
     stsw.w_s('stk_Pointer', old_pointer)
     self.stk_lower = new_lower
     self.stk_upper = new_upper
     # put callee's address on new stack
     new_pointer -= 4
     ctx.mem.access.w32(new_pointer, callee)
     # activate new stack
     ctx.cpu.w_reg(REG_A7, new_pointer)
Esempio n. 7
0
    def MatchFirst(self, lib, ctx):
        pat_ptr = ctx.cpu.r_reg(REG_D1)
        pat = ctx.mem.access.r_cstr(pat_ptr)
        anchor_ptr = ctx.cpu.r_reg(REG_D2)
        anchor = AccessStruct(self.ctx.mem,
                              AnchorPathDef,
                              struct_addr=anchor_ptr)

        # create MatchFirstNext instance
        mfn = MatchFirstNext(self.path_mgr, self.lock_mgr, pat, anchor)
        log_dos.info("MatchFirst: pat='%s' anchor=%06x strlen=%d flags=%02x-> ok=%s" \
          % (pat, anchor_ptr, mfn.str_len, mfn.flags, mfn.ok))
        if not mfn.ok:
            self.io_err = ERROR_BAD_TEMPLATE
            return self.io_err
        log_dos.debug("MatchFirst: %s" % mfn.matcher)

        # no entry found
        if mfn.path == None:
            log_dos.info("MatchFirst: none found!")
            self.matches[anchor_ptr] = None
            self.io_err = ERROR_OBJECT_NOT_FOUND
        # first match
        else:
            self.io_err = mfn.first(ctx)
            log_dos.info(
                "MatchFirst: found path='%s' -> dir path=%s -> parent lock %s, io_err=%d",
                mfn.path, mfn.voldir_path, mfn.dir_lock, self.io_err)
            self.matches[anchor_ptr] = mfn
        return self.io_err
Esempio n. 8
0
 def read(self, ctx, mh_addr):
     self.addr = mh_addr
     mh = AccessStruct(ctx.mem, MemHeaderDef, mh_addr)
     self.first = mh.r_s('mh_First')
     self.lower = mh.r_s('mh_Lower')
     self.upper = mh.r_s('mh_Upper')
     self.free = mh.r_s('mh_Free')
     self.total = self.upper - self.lower
Esempio n. 9
0
 def volume_name_of_lock(self, lock):
   if lock == None:
     return "SYS:"
   else:
     vol_addr  = lock.mem.access.r_s("fl_Volume")
     volnode   = AccessStruct(self.mem,DosListVolumeDef,vol_addr)
     name_addr = volnode.r_s("dol_Name")
     name = self.mem.access.r_bstr(name_addr) + ":"
     return name
Esempio n. 10
0
 def put_msg(self, port_mgr, msg_addr):
     msg = AccessStruct(self.mem, MessageDef, struct_addr=msg_addr)
     dos_pkt_addr = msg.r_s("mn_Node.ln_Name")
     dos_pkt = AccessStruct(self.mem,
                            DosPacketDef,
                            struct_addr=dos_pkt_addr)
     reply_port_addr = dos_pkt.r_s("dp_Port")
     pkt_type = dos_pkt.r_s("dp_Type")
     log_file.info(
         "DosPacket: msg=%06x -> pkt=%06x: reply_port=%06x type=%06x",
         msg_addr, dos_pkt_addr, reply_port_addr, pkt_type)
     # handle packet
     if pkt_type == ord('R'):  # read
         fh_b_addr = dos_pkt.r_s("dp_Arg1")
         buf_ptr = dos_pkt.r_s("dp_Arg2")
         size = dos_pkt.r_s("dp_Arg3")
         # get fh and read
         fh = self.get_by_b_addr(fh_b_addr)
         data = fh.read(size)
         self.mem.access.w_data(buf_ptr, data)
         got = len(data)
         log_file.info(
             "DosPacket: Read fh_b_addr=%06x buf=%06x len=%06x -> got=%06x fh=%s",
             fh_b_addr, buf_ptr, size, got, fh)
         dos_pkt.w_s("dp_Res1", got)
     elif pkt_type == ord('W'):  # write
         fh_b_addr = dos_pkt.r_s("dp_Arg1")
         buf_ptr = dos_pkt.r_s("dp_Arg2")
         size = dos_pkt.r_s("dp_Arg3")
         fh = self.get_by_b_addr(fh_b_addr)
         data = self.mem.access.r_data(buf_ptr, size)
         fh.write(data)
         put = len(data)
         log_file.info(
             "DosPacket: Write fh=%06x buf=%06x len=%06x -> put=%06x fh=%s",
             fh_b_addr, buf_ptr, size, put, fh)
         dos_pkt.w_s("dp_Res1", put)
     else:
         raise UnsupportedFeatureError("Unsupported DosPacket: type=%d" %
                                       pkt_type)
     # do reply
     if not port_mgr.has_port(reply_port_addr):
         port_mgr.register_port(reply_port_addr)
     port_mgr.put_msg(reply_port_addr, msg_addr)
Esempio n. 11
0
 def CallHookPkt(self, ctx):
     hk_ptr = ctx.cpu.r_reg(REG_A0)
     hook = AccessStruct(ctx.mem, HookDef, struct_addr=hk_ptr)
     func = hook.r_s("h_Entry")
     log_utility.info("CallHookPkt(0x%08x) call 0x%08x" % (hk_ptr, func))
     old_stack = ctx.cpu.r_reg(REG_A7)
     old_pc = ctx.cpu.r_reg(REG_PC)
     new_stack = old_stack - 4
     ctx.cpu.w_reg(REG_A7, new_stack)
     ctx.mem.access.w32(new_stack, func)
Esempio n. 12
0
 def DateStamp(self, lib, ctx):
     ds_ptr = ctx.cpu.r_reg(REG_D1)
     ds = AccessStruct(ctx.mem, DateStampDef, struct_addr=ds_ptr)
     t = time.time()
     at = sys_to_ami_time(t)
     log_dos.info("DateStamp: ptr=%06x time=%s" % (ds_ptr, at))
     ds.w_s("ds_Days", at.tday)
     ds.w_s("ds_Minute", at.tmin)
     ds.w_s("ds_Tick", at.tick)
     return ds_ptr
Esempio n. 13
0
 def examine_file(self, fib_mem, name, sys_path):
   # name
   name_addr = fib_mem.s_get_addr('fib_FileName')
   # clear 32 name bytes
   fib_mem.clear_data(name_addr, 32, 0)
   fib_mem.w_cstr(name_addr, name)
   # comment
   comment_addr = fib_mem.s_get_addr('fib_Comment')
   fib_mem.w_cstr(comment_addr, "")
   # create the "inode" information
   key = self.keygen(sys_path)
   fib_mem.w_s('fib_DiskKey',key)
   log_lock.debug("examine key: %08x", key)
   # type
   if os.path.isdir(sys_path):
     dirEntryType = 2
   else:
     dirEntryType = (-3) & 0xffffffff
   fib_mem.w_s('fib_DirEntryType', dirEntryType )
   fib_mem.w_s('fib_EntryType',    dirEntryType )
   # protection
   prot = DosProtection(0)
   try:
     os_stat = os.stat(sys_path)
     mode = os_stat.st_mode
     if mode & stat.S_IXUSR == 0:
       prot.clr(DosProtection.FIBF_EXECUTE)
     if mode & stat.S_IRUSR == 0:
       prot.clr(DosProtection.FIBF_READ)
     if mode & stat.S_IWUSR == 0:
       prot.clr(DosProtection.FIBF_WRITE)
     log_lock.debug("examine lock: '%s' mode=%03o: prot=%s", name, mode, prot)
   except OSError:
     return ERROR_OBJECT_IN_USE
   fib_mem.w_s('fib_Protection', prot.mask)
   # size
   if os.path.isfile(sys_path):
     size = os.path.getsize(sys_path)
     fib_mem.w_s('fib_Size', size)
     blocks = int((size + 511) / 512)
     fib_mem.w_s('fib_NumBlocks', blocks)
   else:
     fib_mem.w_s('fib_NumBlocks', 1)
   # date (use mtime here)
   date_addr = fib_mem.s_get_addr('fib_Date')
   date = AccessStruct(fib_mem.mem, DateStampDef, date_addr)
   t = os.path.getmtime(sys_path)
   at = sys_to_ami_time(t)
   date.w_s('ds_Days', at.tday)
   date.w_s('ds_Minute', at.tmin)
   date.w_s('ds_Tick', at.tick)
   # fill in UID/GID
   fib_mem.w_s('fib_OwnerUID', 0)
   fib_mem.w_s('fib_OwnerGID', 0)
   return NO_ERROR
Esempio n. 14
0
 def Examine(self, lib, ctx):
     lock_b_addr = ctx.cpu.r_reg(REG_D1)
     fib_ptr = ctx.cpu.r_reg(REG_D2)
     lock = self.lock_mgr.get_by_b_addr(lock_b_addr)
     log_dos.info("Examine: %s fib=%06x" % (lock, fib_ptr))
     fib = AccessStruct(ctx.mem, FileInfoBlockDef, struct_addr=fib_ptr)
     self.io_err = self.lock_mgr.examine_lock(lock, fib)
     if self.io_err == NO_ERROR:
         return self.DOSTRUE
     else:
         return self.DOSFALSE
Esempio n. 15
0
 def Insert(self, ctx):
   listNode_addr = ctx.cpu.r_reg(REG_A2)
   if listNode_addr == 0:
     self.AddHead(ctx)
   else:
     node_addr = ctx.cpu.r_reg(REG_A1)
     listNode  = AccessStruct(ctx.mem, NodeDef, listNode_addr)
     n         = AccessStruct(ctx.mem, NodeDef, node_addr)
     succ_addr = listNode.r_s("ln_Succ")
     if succ_addr == 0:
       tail_addr = listNode.r_s("ln_Pred")
       n.w_s("ln_Succ",listNode_addr)
       n.w_s("ln_Pred",tail_addr)
       listNode.w_s("ln_Pred",node_addr)
       AccessStruct(ctx.mem, NodeDef, tail_addr).w_s("ln_Succ",node_addr)
     else:
       s = AccessStruct(ctx.mem, NodeDef, succ_addr)
       n.w_s("ln_Succ",succ_addr)
       n.w_s("ln_Pred",listNode_addr)
       listNode.w_s("ln_Succ",node_addr)
       s.w_s("ln_Pred",node_addr)
Esempio n. 16
0
 def _fill_fib(self, ctx, path):
     # fill FileInfo of first match in anchor
     lock = self.lock_mgr.create_lock(path, False)
     fib_ptr = self.anchor.s_get_addr('ap_Info')
     fib = AccessStruct(ctx.mem, FileInfoBlockDef, struct_addr=fib_ptr)
     io_err = lock.examine_lock(fib)
     self.lock_mgr.release_lock(lock)
     # store path name of first name at end of structure
     if self.str_len > 0:
         path_ptr = self.anchor.s_get_addr('ap_Buf')
         self.anchor.w_cstr(path_ptr, path)
     return io_err
Esempio n. 17
0
 def CloseDevice(self,ctx):
   io_addr  = ctx.cpu.r_reg(REG_A1)
   if io_addr != 0:
     io       = AccessStruct(ctx.mem, IORequestDef, io_addr)
     dev_addr = io.r_s("io_Device")
     if dev_addr != 0:
       dev = self.lib_mgr.close_dev(dev_addr,ctx)
       io.w_s("io_Device",0)
       if dev != None:
         log_exec.info("CloseDevice: '%s' -> %06x" % (dev, dev.addr_base))
       else:
         raise VamosInternalError("CloseDevice: Unknown library to close: ptr=%06x" % dev_addr)
Esempio n. 18
0
 def _release_locklist(self, entry):
   alist_addr    = entry.access.r_s("dol_List")
   entry.access.w_s("dol_List",0)
   entry.alist   = []
   while alist_addr != 0:
     alist        = AccessStruct(self.mem,AssignListDef,alist_addr)
     oldlock_addr = alist.r_s("al_Lock")
     oldlock      = self.lock_mgr.get_by_b_addr(oldlock_addr >> 2)
     self.lock_mgr.release_lock(oldlock)
     entry.alist.remove(alist)
     nextaddr     = alist.access.r_s("al_Next")
     self.alloc.free_struct(alist.mem)
     alist_addr   = nextaddr
Esempio n. 19
0
 def _add_entry(self, entry):
   # allocate amiga entry
   entry.locks  = []
   entry.alist  = []
   entry.mem    = self.alloc.alloc_struct(entry.name,entry.struct_def)
   entry.baddr  = entry.mem.addr >> 2
   entry.access = AccessStruct(self.mem,entry.struct_def,entry.mem.addr)
   entry.name_addr = self.alloc.alloc_bstr("DosListName",entry.name)
   entry.access.w_s("dol_Name",entry.name_addr.addr)
   # register in lists
   self.entries_by_b_addr[entry.baddr] = entry
   self.entries_by_name[entry.name.lower()] = entry
   self.entries.append(entry)
   log_doslist.info("add entry: %s", entry)
Esempio n. 20
0
 def OpenDevice(self,ctx):
   name_ptr = ctx.cpu.r_reg(REG_A0)
   unit     = ctx.cpu.r_reg(REG_D0)
   io_addr  = ctx.cpu.r_reg(REG_A1)
   io       = AccessStruct(ctx.mem, IORequestDef, io_addr)
   flags    = ctx.cpu.r_reg(REG_D1)
   name     = ctx.mem.access.r_cstr(name_ptr)
   lib      = self.lib_mgr.open_dev(name, unit, flags, io, ctx)
   if lib == None:
     log_exec.info("OpenDevice: '%s' unit %d flags %d -> NULL" % (name, unit, flags))
     return -1
   else:
     log_exec.info("OpenDevice: '%s' unit %d flags %d -> %s" % (name, unit, flags, lib))
     return 0
Esempio n. 21
0
 def InitSemaphore(self, addr):
     semaphore = AccessStruct(self.mem,
                              SignalSemaphoreDef,
                              struct_addr=addr)
     semaphore.w_s("ss_Owner", 0)
     semaphore.w_s("ss_NestCount", 0)
     semaphore.w_s("ss_QueueCount", 0xffff)
     semaphore.w_s("ss_Link.ln_Type", self.NT_SIGNALSEM)
     semaphore.w_s("ss_WaitQueue.mlh_Head",
                   semaphore.s_get_addr("ss_WaitQueue.mlh_Tail"))
     semaphore.w_s("ss_WaitQueue.mlh_Tail", 0)
     semaphore.w_s("ss_WaitQueue.mlh_TailPred",
                   semaphore.s_get_addr("ss_WaitQueue.mlh_Head"))
     return self.register_semaphore(addr)
Esempio n. 22
0
 def _fill_fib(self, ctx, path):
   # fill FileInfo of first match in anchor
   lock = self.lock_mgr.create_lock(self.lock, path, False)
   if lock == None:
     return ERROR_OBJECT_NOT_FOUND
   fib_ptr = self.anchor.s_get_addr('ap_Info')
   fib = AccessStruct(ctx.mem,FileInfoBlockDef,struct_addr=fib_ptr)
   io_err = lock.examine_lock(fib)
   self.lock_mgr.release_lock(lock)
   # store path name of first name at end of structure
   if self.str_len > 0:
     path_ptr = self.anchor.s_get_addr('ap_Buf')
     #print "putting path %s,%s into ap_Buf" % (path,path[file_part(path):])
     self.anchor.w_cstr(path_ptr, path) #[file_part(path):])
   return io_err
Esempio n. 23
0
 def examine_file(self, fib_mem, name, sys_path):
   # name
   name_addr = fib_mem.s_get_addr('fib_FileName')
   fib_mem.w_cstr(name_addr, name)
   # create the "inode" information
   key = self.keygen(sys_path)
   fib_mem.w_s('fib_DiskKey',key)
   # type
   if os.path.isdir(sys_path):
     dirEntryType = 2
   else:
     dirEntryType = (-3) & 0xffffffff
   fib_mem.w_s('fib_DirEntryType', dirEntryType )
   fib_mem.w_s('fib_EntryType',    dirEntryType )
   # protection
   prot = DosProtection(0)
   try:
     os_stat = os.stat(sys_path)
     mode = os_stat.st_mode
     if mode & stat.S_IXUSR == 0:
       prot.clr(DosProtection.FIBF_EXECUTE)
     if mode & stat.S_IRUSR == 0:
       prot.clr(DosProtection.FIBF_READ)
     if mode & stat.S_IWUSR == 0:
       prot.clr(DosProtection.FIBF_WRITE)
       prot.clr(DosProtection.FIBF_DELETE)
     if mode & stat.S_ISUID != 0:
       prot.set(DosProtection.FIBF_PURE)
     if mode & stat.S_ISGID != 0:
       prot.set(DosProtection.FIBF_SCRIPT)
     log_lock.debug("examine lock: '%s' mode=%03o: prot=%s", name, mode, prot)
   except OSError:
     return ERROR_OBJECT_IN_USE
   fib_mem.w_s('fib_Protection', prot.mask)
   # size
   if os.path.isfile(sys_path):
     size = os.path.getsize(sys_path)
     fib_mem.w_s('fib_Size', size)
   # date (use mtime here)
   date_addr = fib_mem.s_get_addr('fib_Date')
   date = AccessStruct(fib_mem.mem, DateStampDef, date_addr)
   t = os.path.getmtime(sys_path)
   at = sys_to_ami_time(t)
   date.w_s('ds_Days', at.tday)
   date.w_s('ds_Minute', at.tmin)
   date.w_s('ds_Tick', at.tick)
   return NO_ERROR
Esempio n. 24
0
    def GetDeviceProc(self, lib, ctx):
        name_ptr = ctx.cpu.r_reg(REG_D1)
        last_devproc = ctx.cpu.r_reg(REG_D2)
        name = ctx.mem.access.r_cstr(name_ptr)

        # get volume of path
        abs_name = self.path_mgr.ami_abs_path(name)
        volume = self.path_mgr.ami_volume_of_path(abs_name)
        vol_lock = self.lock_mgr.create_lock(volume + ":", False)
        fs_port = self.file_mgr.get_fs_handler_port()
        addr = self._alloc_mem("DevProc:%s" % name, DevProcDef.get_size())
        log_dos.info(
            "GetDeviceProc: name='%s' devproc=%06x -> volume=%s devproc=%06x",
            name, last_devproc, volume, addr)
        devproc = AccessStruct(self.ctx.mem, DevProcDef, struct_addr=addr)
        devproc.w_s('dvp_Port', fs_port)
        devproc.w_s('dvp_Lock', vol_lock.b_addr)
        self.io_err = NO_ERROR
        return addr
Esempio n. 25
0
 def write(self, ctx):
     mh = AccessStruct(ctx.mem, MemHeaderDef, self.addr)
     # only update first/free
     mh.w_s('mh_First', self.first)
     mh.w_s('mh_Free', self.free)
Esempio n. 26
0
 def _register_file(self, fh):
     baddr = fh.alloc_fh(self.alloc, self.fs_handler_port)
     self.files_by_b_addr[baddr] = fh
     handle = AccessStruct(self.mem, FileHandleDef, struct_addr=baddr * 4)
     handle.w_s("fh_End", 0xffffffff)
     log_file.info("registered: %s" % fh)
Esempio n. 27
0
 def write(self, ctx):
     mc = AccessStruct(ctx.mem, MemChunkDef, self.addr)
     mc.w_s('mc_Next', self.next)
     mc.w_s('mc_Bytes', self.bytes)
Esempio n. 28
0
 def read(self, ctx, mc_addr):
     self.addr = mc_addr
     mc = AccessStruct(ctx.mem, MemChunkDef, mc_addr)
     self.next = mc.r_s('mc_Next')
     self.bytes = mc.r_s('mc_Bytes')
Esempio n. 29
0
def get_tag(ctx, ti_addr):
  ti = AccessStruct(ctx.mem, TagItemDef, ti_addr)
  tag = ti.r_s("ti_Tag")
  data = ti.r_s("ti_Data")
  return tag, data