OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
TPEF::ASpaceSection Class Reference

#include <ASpaceSection.hh>

Inheritance diagram for TPEF::ASpaceSection:
Inheritance graph
Collaboration diagram for TPEF::ASpaceSection:
Collaboration graph

Public Member Functions

virtual ~ASpaceSection ()
 
virtual SectionType type () const
 
bool isUndefined (ASpaceElement *aSpace) const
 
void setUndefinedASpace (ASpaceElement *aSpace)
 
ASpaceElementundefinedASpace () const
 
- Public Member Functions inherited from TPEF::Section
virtual ~Section ()
 
virtual bool isChunkable () const
 
virtual Chunkchunk (SectionOffset offset) const
 
bool isProgramSection () const
 
bool isAuxSection () const
 
virtual void addElement (SectionElement *element)
 
virtual void setElement (Word index, SectionElement *element)
 
SectionElementelement (Word index) const
 
Word elementCount () const
 
void setFlagNoBits ()
 
void unsetFlagNoBits ()
 
bool noBits () const
 
bool vLen () const
 
Byte flags () const
 
void setFlags (Byte flagByte)
 
void setStartingAddress (AddressImage address)
 
AddressImage startingAddress () const
 
void setLink (const ReferenceManager::SafePointer *aLink)
 
void setLink (Section *aLink)
 
Sectionlink () const
 
void setASpace (const ReferenceManager::SafePointer *addrSpace)
 
void setASpace (ASpaceElement *addrSpace)
 
ASpaceElementaSpace () const
 
void setName (const ReferenceManager::SafePointer *sectionName)
 
void setName (Chunk *sectionName)
 
Chunkname () const
 
virtual bool isDataSection () const
 
virtual bool isCodeSection () const
 
- Public Member Functions inherited from TPEF::SafePointable
virtual ~SafePointable ()
 

Protected Member Functions

 ASpaceSection (bool init)
 
virtual Sectionclone () const
 
- Protected Member Functions inherited from TPEF::Section
 Section ()
 
void setFlagVLen ()
 
void unsetFlagVLen ()
 
- Protected Member Functions inherited from TPEF::SafePointable
 SafePointable ()
 

Private Attributes

const ReferenceManager::SafePointerundefinedElement_
 Undefined address space. This element is not allowed to be removed from section is recognized as special undefined address space. More...
 

Static Private Attributes

static ASpaceSection proto_
 Prototype instance. More...
 

Additional Inherited Members

- Public Types inherited from TPEF::Section
enum  SectionType {
  ST_NULL = 0x00, ST_STRTAB = 0x01, ST_SYMTAB = 0x02, ST_DEBUG = 0x03,
  ST_RELOC = 0x04, ST_LINENO = 0x05, ST_NOTE = 0x06, ST_ADDRSP = 0x07,
  ST_MR = 0x0A, ST_CODE = 0x81, ST_DATA = 0x82, ST_UDATA = 0x83,
  ST_LEDATA = 0x84, ST_DUMMY = 0xff
}
 
enum  SectionFlag { SF_VLEN = 0x40, SF_NOBITS = 0x80 }
 
- Static Public Member Functions inherited from TPEF::Section
static SectioncreateSection (SectionType type)
 
static bool isProgramSection (SectionType type)
 
- Static Protected Member Functions inherited from TPEF::Section
static void registerSection (const Section *section)
 

Detailed Description

Address space section.

Definition at line 44 of file ASpaceSection.hh.

Constructor & Destructor Documentation

◆ ~ASpaceSection()

TPEF::ASpaceSection::~ASpaceSection ( )
virtual

Destructor

Definition at line 63 of file ASpaceSection.cc.

63  {
64 }

◆ ASpaceSection()

TPEF::ASpaceSection::ASpaceSection ( bool  init)
protected

Constructor.

Parameters
inittrue if registeration is wanted

Definition at line 48 of file ASpaceSection.cc.

48  :
50 
51  if (init) {
53  }
54 
55  unsetFlagVLen();
58 }

References TPEF::Section::registerSection(), TPEF::Section::setStartingAddress(), TPEF::Section::unsetFlagNoBits(), and TPEF::Section::unsetFlagVLen().

Referenced by clone().

Here is the call graph for this function:

Member Function Documentation

◆ clone()

Section * TPEF::ASpaceSection::clone ( ) const
protectedvirtual

Creates an instance of class.

Returns
Newly created section.

Implements TPEF::Section.

Definition at line 82 of file ASpaceSection.cc.

82  {
83  return new ASpaceSection(false);
84 }

References ASpaceSection().

Here is the call graph for this function:

◆ isUndefined()

bool TPEF::ASpaceSection::isUndefined ( ASpaceElement aSpace) const

Checks if the parameter, is undefined address space.

Parameters
aSpaceElement to check.
Returns
True, if parameter is the undefined address space.

Definition at line 93 of file ASpaceSection.cc.

93  {
94  assert(aSpace != NULL);
96  return (undefinedElement_->pointer() == aSpace);
97 }

References TPEF::Section::aSpace(), assert, TPEF::ReferenceManager::SafePointer::null, TPEF::ReferenceManager::SafePointer::pointer(), and undefinedElement_.

Referenced by TPEFDumper::addressSpaceString(), and TPEF::TPEFRelocSectionReader::finalize().

Here is the call graph for this function:

◆ setUndefinedASpace()

void TPEF::ASpaceSection::setUndefinedASpace ( ASpaceElement aSpace)

Set undefined address space.

This method must be runned, before checking of undefined address space is allowed. If set is runned many times, it overrides earlier setings.

Parameters
aSpaceElement to define as undefined address space.

Definition at line 109 of file ASpaceSection.cc.

109  {
110  assert(aSpace != NULL);
111  assert(aSpace->MAU() == 0);
112  assert(aSpace->align() == 0);
113  assert(aSpace->wordSize() == 0);
116 }

References TPEF::ASpaceElement::align(), TPEF::Section::aSpace(), assert, TPEF::ASpaceElement::MAU(), TPEF::ReferenceManager::SafePointer::replaceReference(), undefinedElement_, and TPEF::ASpaceElement::wordSize().

Referenced by TTAProgram::ProgramWriter::createBinary(), TPEF::TPEFASpaceSectionReader::readData(), TPEF::AOutReader::readData(), and MachineResourceManager::undefinedAddressSpace().

Here is the call graph for this function:

◆ type()

Section::SectionType TPEF::ASpaceSection::type ( ) const
virtual

Returns sections type.

Returns
type of section.

Implements TPEF::Section.

Definition at line 72 of file ASpaceSection.cc.

72  {
73  return ST_ADDRSP;
74 }

References TPEF::Section::ST_ADDRSP.

◆ undefinedASpace()

ASpaceElement * TPEF::ASpaceSection::undefinedASpace ( ) const

Returns undefined address space element.

Returns
Undefined address space element.

Definition at line 124 of file ASpaceSection.cc.

124  {
125  return dynamic_cast<ASpaceElement*>(
127 }

References TPEF::ReferenceManager::SafePointer::pointer(), and undefinedElement_.

Referenced by TTAProgram::ProgramWriter::createRelocSections().

Here is the call graph for this function:

Member Data Documentation

◆ proto_

ASpaceSection TPEF::ASpaceSection::proto_
staticprivate

Prototype instance.

Definition at line 62 of file ASpaceSection.hh.

◆ undefinedElement_

const ReferenceManager::SafePointer* TPEF::ASpaceSection::undefinedElement_
private

Undefined address space. This element is not allowed to be removed from section is recognized as special undefined address space.

Definition at line 66 of file ASpaceSection.hh.

Referenced by isUndefined(), setUndefinedASpace(), and undefinedASpace().


The documentation for this class was generated from the following files:
TPEF::ReferenceManager::SafePointer::replaceReference
static const SafePointer * replaceReference(const SafePointer *old, SafePointable *obj)
TPEF::Section::aSpace
ASpaceElement * aSpace() const
TPEF::Section::unsetFlagVLen
void unsetFlagVLen()
TPEF::ReferenceManager::SafePointer::null
static const SafePointer null
The default SafePointer that is used in null references.
Definition: SafePointer.hh:229
TPEF::ASpaceElement::wordSize
Byte wordSize() const
TPEF::ASpaceElement::MAU
Byte MAU() const
assert
#define assert(condition)
Definition: Application.hh:86
TPEF::Section::Section
Section()
Definition: Section.cc:64
TPEF::ReferenceManager::SafePointer::pointer
SafePointable * pointer() const
TPEF::Section::unsetFlagNoBits
void unsetFlagNoBits()
TPEF::Section::setStartingAddress
void setStartingAddress(AddressImage address)
TPEF::Section::registerSection
static void registerSection(const Section *section)
Definition: Section.cc:114
TPEF::ASpaceSection::ASpaceSection
ASpaceSection(bool init)
Definition: ASpaceSection.cc:48
TPEF::ASpaceSection::undefinedElement_
const ReferenceManager::SafePointer * undefinedElement_
Undefined address space. This element is not allowed to be removed from section is recognized as spec...
Definition: ASpaceSection.hh:66
TPEF::ASpaceElement::align
Byte align() const
TPEF::Section::ST_ADDRSP
@ ST_ADDRSP
Address space section.
Definition: Section.hh:77