1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 509 unchanged lines hidden (view full) ---

518 code('''
519int ${{self.c_ident}}_base_level(const ${{self.c_ident}}& obj);
520MachineType ${{self.c_ident}}_from_base_level(int);
521int ${{self.c_ident}}_base_number(const ${{self.c_ident}}& obj);
522int ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj);
523''')
524
525 for enum in self.enums.itervalues():
526 if enum.ident == "DMA":
527 code('''
528MachineID map_Address_to_DMA(const Addr &addr);
529''')
526 code('''
527
528MachineID get${{enum.ident}}MachineID(NodeID RubyNode);
529''')
530
531 if self.isStateDecl:
532 code('''
533

--- 231 unchanged lines hidden (view full) ---

765 case ${{self.c_ident}}_NUM:
766 default:
767 panic("Invalid range for type ${{self.c_ident}}");
768 }
769}
770''')
771
772 for enum in self.enums.itervalues():
777 if enum.ident == "DMA":
778 code('''
779MachineID
780map_Address_to_DMA(const Addr &addr)
781{
782 MachineID dma = {MachineType_DMA, 0};
783 return dma;
784}
785''')
786
773 code('''
774
775MachineID
776get${{enum.ident}}MachineID(NodeID RubyNode)
777{
778 MachineID mach = {MachineType_${{enum.ident}}, RubyNode};
779 return mach;
780}
781''')
782
783 # Write the file
784 code.write(path, "%s.cc" % self.c_ident)
785
786__all__ = [ "Type" ]