Changeset 2556 in CLRX


Ignore:
Timestamp:
Nov 10, 2016, 9:32:32 PM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Make ElfNote? as simple structure (use initializer list to construct).

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdbin/ElfBinaries.h

    r2554 r2556  
    670670    const cxbyte* desc;
    671671    uint32_t type;
    672    
    673     ElfNote() : name(nullptr), descSize(0), desc(nullptr), type(0)
    674     { }
    675     ElfNote(const char* _name, size_t _descSize, const cxbyte* _desc, uint32_t _type)
    676         : name(_name), descSize(_descSize), desc(_desc), type(_type)
    677     { }
    678672};
    679673
  • CLRadeonExtender/trunk/amdbin/AmdCL2BinGen.cpp

    r2554 r2556  
    19451945             * AMD - 5 - size=0x19 \x16\000-hsa_call_convention=\0\0
    19461946             */
    1947             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType1, noteDescType1, 1U));
    1948             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType2, noteDescType2, 2U));
     1947            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType1, noteDescType1, 1U});
     1948            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType2, noteDescType2, 2U});
    19491949            noteBuf.reset(new cxbyte[0x1a]);
    19501950            ::memcpy(noteBuf.get(), noteDescType3, 0x1a);
     
    19521952            SULEV(*(uint32_t*)(noteBuf.get()+8), amdGpuArchValues.minor);
    19531953            SULEV(*(uint32_t*)(noteBuf.get()+12), amdGpuArchValues.stepping);
    1954             innerBinGen->addNote(ElfNote("AMD", 0x1a, noteBuf.get(), 3U));
    1955             innerBinGen->addNote(ElfNote("AMD",
    1956                          sizeof noteDescType4_16_3, noteDescType4_16_3, 4U));
     1954            innerBinGen->addNote(ElfNote{"AMD", 0x1a, noteBuf.get(), 3U});
     1955            innerBinGen->addNote(ElfNote{"AMD",
     1956                         sizeof noteDescType4_16_3, noteDescType4_16_3, 4U});
    19571957            if (!gpuProDriver)
    1958                 innerBinGen->addNote(ElfNote("AMD",
    1959                              sizeof noteDescType5_16_3, noteDescType5_16_3, 5U));
     1958                innerBinGen->addNote(ElfNote{"AMD",
     1959                             sizeof noteDescType5_16_3, noteDescType5_16_3, 5U});
    19601960            else
    1961                 innerBinGen->addNote(ElfNote("AMD",
    1962                              sizeof noteDescType5_gpupro, noteDescType5_gpupro, 5U));
     1961                innerBinGen->addNote(ElfNote{"AMD",
     1962                             sizeof noteDescType5_gpupro, noteDescType5_gpupro, 5U});
    19631963           
    19641964            innerBinGen->addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 8,
     
    20352035             * AMD - 4 - size=8 random values 0x7ffXXXXXXXX
    20362036             */
    2037             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType1, noteDescType1, 1U));
    2038             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType2, noteDescType2, 2U));
    2039             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType5, noteDescType5, 5U));
     2037            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType1, noteDescType1, 1U});
     2038            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType2, noteDescType2, 2U});
     2039            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType5, noteDescType5, 5U});
    20402040            noteBuf.reset(new cxbyte[0x1e]);
    20412041            ::memcpy(noteBuf.get(), noteDescType3, 0x1e);
     
    20432043            SULEV(*(uint32_t*)(noteBuf.get()+8), amdGpuArchValues.minor);
    20442044            SULEV(*(uint32_t*)(noteBuf.get()+12), amdGpuArchValues.stepping);
    2045             innerBinGen->addNote(ElfNote("AMD", 0x1e, noteBuf.get(), 3U));
    2046             innerBinGen->addNote(ElfNote("AMD", sizeof noteDescType4, noteDescType4, 4U));
     2045            innerBinGen->addNote(ElfNote{"AMD", 0x1e, noteBuf.get(), 3U});
     2046            innerBinGen->addNote(ElfNote{"AMD", sizeof noteDescType4, noteDescType4, 4U});
    20472047           
    20482048            innerBinGen->addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 8,
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r2554 r2556  
    222222    elfBinGen64.addDynamics(sizeof(dynTags)/sizeof(int32_t), dynTags);
    223223   
    224     elfBinGen64.addNote(ElfNote("AMD", sizeof noteDescType1, noteDescType1, 1U));
     224    elfBinGen64.addNote(ElfNote{"AMD", sizeof noteDescType1, noteDescType1, 1U});
    225225    std::unique_ptr<cxbyte[]> noteBuf(new cxbyte[0x1b]);
    226226    ::memcpy(noteBuf.get(), noteDescType3, 0x1e);
     
    228228    //SULEV(*(uint32_t*)(noteBuf.get()+8), amdGpuArchValues.minor);
    229229    //SULEV(*(uint32_t*)(noteBuf.get()+12), amdGpuArchValues.stepping);
    230     elfBinGen64.addNote(ElfNote("AMD", 0x1b, noteBuf.get(), 3U));
     230    elfBinGen64.addNote(ElfNote{"AMD", 0x1b, noteBuf.get(), 3U});
    231231   
    232232    elfBinGen64.addRegion(ElfRegion64::programHeaderTable());
Note: See TracChangeset for help on using the changeset viewer.