VirtualBox

Changeset 120 in kStuff for trunk/include/k/kDefs.h


Ignore:
Timestamp:
Feb 18, 2022 2:00:53 AM (3 years ago)
Author:
bird
Message:

kDefs.h: Added risc-v to the K_ARCH_XXX defines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/k/kDefs.h

    r116 r120  
    189189/** 64-bit SPARC. */
    190190#define K_ARCH_SPARC_64         (12 | K_ARCH_BIT_64 | K_ARCH_END_BI)
     191/** 32-bit RISC-V, little endian. */
     192#define K_ARCH_RISCV_32         (13 | K_ARCH_BIT_32 | K_ARCH_END_LITTLE)
     193/** 32-bit RISC-V, big endian. */
     194#define K_ARCH_RISCV_32_BE      (13 | K_ARCH_BIT_32 | K_ARCH_END_BIG)
     195/** 64-bit RISC-V, little endian. */
     196#define K_ARCH_RISCV_64         (13 | K_ARCH_BIT_64 | K_ARCH_END_LITTLE)
     197/** 64-bit RISC-V, big endian. */
     198#define K_ARCH_RISCV_64_BE      (13 | K_ARCH_BIT_64 | K_ARCH_END_BIG)
    191199/** The end of the valid architecture values (exclusive). */
    192200#define K_ARCH_MAX              (12+1)
     
    225233# elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
    226234#  define K_ARCH    K_ARCH_POWERPC_32
     235# elif defined(__riscv)
     236#  if __BYTE_ORDER__ == WORDS_BIG_ENDIAN
     237#   if defined(__riscv32) || __riscv_xlen+0 == 32
     238#    define K_ARCH  K_ARCH_RISCV_32_BE
     239#   else
     240#    define K_ARCH  K_ARCH_RISCV_64_BE
     241#   endif
     242#  elif defined(__riscv32) || __riscv_xlen+0 == 32
     243#   define K_ARCH   K_ARCH_RISCV_32
     244#  else
     245#   define K_ARCH   K_ARCH_RISCV_64
     246#  endif
    227247# elif defined(__sparcv9__) || defined(__sparcv9)
    228248#  define K_ARCH    K_ARCH_SPARC_64
     
    235255# elif defined(__sh__)
    236256#  if !defined(__SH5__)
    237 #   define K_ARCH    K_ARCH_SH_32
     257#   define K_ARCH   K_ARCH_SH_32
    238258#  else
    239259#   if __SH5__ == 64
    240 #    define K_ARCH   K_ARCH_SH_64
     260#    define K_ARCH  K_ARCH_SH_64
    241261#   else
    242 #    define K_ARCH   K_ARCH_SH_32
     262#    define K_ARCH  K_ARCH_SH_32
    243263#   endif
    244264#  endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette