Ignore:
Timestamp:
Sep 3, 2007, 3:18:26 AM (18 years ago)
Author:
bird
Message:

Cpu / architecture cleanup...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/include/k/kLdr.h

    r3579 r3585  
    3737#include <k/kDefs.h>
    3838#include <k/kTypes.h>
     39#include <k/kCpus.h>
    3940
    4041
     
    166167/** @defgroup grp_kLdrMod   kLdrMod - The executable image intepreter
    167168 * @{ */
    168 
    169 /**
    170  * CPU Architecture.
    171  * @todo Double check the non intel architectures.
    172  */
    173 typedef enum KLDRARCH
    174 {
    175     /** The usual invalid one. */
    176     KLDRARCH_INVALID = 0,
    177     /** Clone or Intel 16-bit x86. */
    178     KLDRARCH_X86_16,
    179     /** Clone or Intel 32-bit x86. */
    180     KLDRARCH_X86_32,
    181     /** AMD64 (including clones). */
    182     KLDRARCH_AMD64,
    183     /** Itanic (64-bit). */
    184     KLDRARCH_IA64,
    185     /** ALPHA (64-bit). */
    186     KLDRARCH_ALPHA,
    187     /** ALPHA limited to 32-bit. */
    188     KLDRARCH_ALPHA_32,
    189     /** 32-bit ARM. */
    190     KLDRARCH_ARM_32,
    191     /** 64-bit ARM. */
    192     KLDRARCH_ARM_64,
    193     /** 32-bit MIPS. */
    194     KLDRARCH_MIPS_32,
    195     /** 64-bit MIPS. */
    196     KLDRARCH_MIPS_64,
    197     /** 32-bit PowerPC. */
    198     KLDRARCH_POWERPC_32,
    199     /** 64-bit PowerPC. */
    200     KLDRARCH_POWERPC_64,
    201     /** 32-bit SPARC. */
    202     KLDRARCH_SPARC_32,
    203     /** 64-bit SPARC. */
    204     KLDRARCH_SPARC_64,
    205     /** The end of the valid architecture values (exclusive). */
    206     KLDRARCH_END,
    207     /** Hack to blow the type up to 32-bit. */
    208     KLDRARCH_32BIT_HACK = 0x7fffffff
    209 } KLDRARCH;
    210 /** Pointer to a CPU architecture type. */
    211 typedef KLDRARCH *PKLDRARCH;
    212 
    213 /**
    214  * CPU models.
    215  */
    216 typedef enum KLDRCPU
    217 {
    218     /** The usual invalid cpu. */
    219     KLDRCPU_INVALID = 0,
    220     /** @name KLDRARCH_X86_16
    221      * @{ */
    222     KLDRCPU_I8086,
    223     KLDRCPU_I8088,
    224     KLDRCPU_I80186,
    225     KLDRCPU_I80286,
    226     KLDRCPU_I386_16,
    227     KLDRCPU_I486_16,
    228     KLDRCPU_I486SX_16,
    229     KLDRCPU_I586_16,
    230     KLDRCPU_I686_16,
    231     KLDRCPU_P4_16,
    232     KLDRCPU_CORE2_16,
    233     KLDRCPU_K6_16,
    234     KLDRCPU_K7_16,
    235     KLDRCPU_K8_16,
    236     KLDRCPU_FIRST_X86_16 = KLDRCPU_I8086,
    237     KLDRCPU_LAST_X86_16 = KLDRCPU_K8_16,
    238     /** @} */
    239 
    240     /** @name KLDRARCH_X86_32
    241      * @{ */
    242     KLDRCPU_X86_32_BLEND,
    243     KLDRCPU_I386,
    244     KLDRCPU_I486,
    245     KLDRCPU_I486SX,
    246     KLDRCPU_I586,
    247     KLDRCPU_I686,
    248     KLDRCPU_P4,
    249     KLDRCPU_CORE2_32,
    250     KLDRCPU_K6,
    251     KLDRCPU_K7,
    252     KLDRCPU_K8_32,
    253     KLDRCPU_FIRST_X86_32 = KLDRCPU_I386,
    254     KLDRCPU_LAST_X86_32 = KLDRCPU_K8_32,
    255     /** @} */
    256 
    257     /** @name KLDRARCH_AMD64
    258      * @{ */
    259     KLDRCPU_AMD64_BLEND,
    260     KLDRCPU_K8,
    261     KLDRCPU_P4_64,
    262     KLDRCPU_CORE2,
    263     KLDRCPU_FIRST_AMD64 = KLDRCPU_K8,
    264     KLDRCPU_LAST_AMD64 = KLDRCPU_CORE2,
    265     /** @} */
    266 
    267     /** The end of the valid cpu values (exclusive). */
    268     KLDRCPU_END,
    269     /** Hack to blow the type up to 32-bit. */
    270     KLDRCPU_32BIT_HACK = 0x7fffffff
    271 } KLDRCPU;
    272 /** Pointer to a CPU type. */
    273 typedef KLDRCPU *PKLDRCPU;
    274 
    275 void kLdrGetArchCpu(PKLDRARCH penmArch, PKLDRCPU penmCpu);
    276 int kLdrCompareCpus(KLDRARCH enmCodeArch, KLDRCPU enmCodeCpu, KLDRARCH enmArch, KLDRCPU enmCpu);
    277 
    278169
    279170/**
     
    486377    /** The type of module. */
    487378    KLDRTYPE            enmType;
    488     /** The architecture this module was built for. */
    489     KLDRARCH            enmArch;
     379    /** The CPU architecture this module was built for. */
     380    KCPUARCH            enmArch;
    490381    /** The minium cpu this module was built for.
    491382     * This might not be accurate, so use kLdrModCanExecuteOn() to check. */
    492     KLDRARCH            enmCpu;
     383    KCPU                enmCpu;
    493384    /** The endian used by the module. */
    494385    KLDRENDIAN          enmEndian;
     
    704595int     kLdrModGetImport(PKLDRMOD pMod, const void *pvBits, KU32 iImport, char *pszName, KSIZE cchName);
    705596KI32    kLdrModNumberOfImports(PKLDRMOD pMod, const void *pvBits);
    706 int     kLdrModCanExecuteOn(PKLDRMOD pMod, const void *pvBits, KLDRARCH enmArch, KLDRCPU enmCpu);
     597int     kLdrModCanExecuteOn(PKLDRMOD pMod, const void *pvBits, KCPUARCH enmArch, KCPU enmCpu);
    707598int     kLdrModGetStackInfo(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, PKLDRSTACKINFO pStackInfo);
    708599int     kLdrModQueryMainEntrypoint(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, PKLDRADDR pMainEPAddress);
     
    783674    KI32 (* pfnNumberOfImports)(PKLDRMOD pMod, const void *pvBits);
    784675    /** @copydoc kLdrModCanExecuteOn */
    785     int (* pfnCanExecuteOn)(PKLDRMOD pMod, const void *pvBits, KLDRARCH enmArch, KLDRCPU enmCpu);
     676    int (* pfnCanExecuteOn)(PKLDRMOD pMod, const void *pvBits, KCPUARCH enmArch, KCPU enmCpu);
    786677    /** @copydoc kLdrModGetStackInfo */
    787678    int (* pfnGetStackInfo)(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, PKLDRSTACKINFO pStackInfo);
Note: See TracChangeset for help on using the changeset viewer.