No need to force md code to define a macro that's the same as

_BYTE_ORDER. Use that instead.
This commit is contained in:
Warner Losh 2018-04-16 13:52:23 +00:00
parent db911ed570
commit 9d89a9f326
5 changed files with 5 additions and 20 deletions

View File

@ -95,7 +95,4 @@ int db_validate_address(vm_offset_t);
u_int branch_taken (u_int insn, db_addr_t pc);
#ifdef __ARMEB__
#define BYTE_MSF (1)
#endif
#endif /* !_MACHINE_DB_MACHDEP_H_ */

View File

@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kdb.h>
#include <sys/endian.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
@ -51,10 +52,6 @@ static unsigned db_extend[] = { /* table for sign-extending */
0xFF800000U
};
#ifndef BYTE_MSF
#define BYTE_MSF 0
#endif
db_expr_t
db_get_value(db_addr_t addr, int size, bool is_signed)
{
@ -69,9 +66,9 @@ db_get_value(db_addr_t addr, int size, bool is_signed)
}
value = 0;
#if BYTE_MSF
#if _BYTE_ORDER == _BIG_ENDIAN
for (i = 0; i < size; i++)
#else /* BYTE_LSF */
#else /* _LITTLE_ENDIAN */
for (i = size - 1; i >= 0; i--)
#endif
{
@ -91,9 +88,9 @@ db_put_value(db_addr_t addr, int size, db_expr_t value)
char data[sizeof(int)];
int i;
#if BYTE_MSF
#if _BYTE_ORDER == _BIG_ENDIAN
for (i = size - 1; i >= 0; i--)
#else /* BYTE_LSF */
#else /* _LITTLE_ENDIAN */
for (i = 0; i < size; i++)
#endif
{

View File

@ -41,7 +41,6 @@
#include <machine/frame.h>
#include <machine/trap.h>
#include <machine/endian.h>
typedef struct trapframe db_regs_t;
extern db_regs_t ddb_regs; /* register state */
@ -49,10 +48,6 @@ extern db_regs_t ddb_regs; /* register state */
typedef vm_offset_t db_addr_t; /* address - unsigned */
typedef register_t db_expr_t; /* expression - signed */
#if BYTE_ORDER == _BIG_ENDIAN
#define BYTE_MSF (1)
#endif
#define SOFTWARE_SSTEP /* Need software single step */
#define SOFTWARE_SSTEP_EMUL /* next_instr_address() emulates 100% */
db_addr_t next_instr_address(db_addr_t, boolean_t);

View File

@ -40,8 +40,6 @@
#define DB_ELF_SYMBOLS
#define DB_ELFSIZE __ELF_WORD_SIZE
#define BYTE_MSF (1)
typedef vm_offset_t db_addr_t; /* address - unsigned */
typedef intptr_t db_expr_t; /* expression - signed */

View File

@ -33,8 +33,6 @@
#include <machine/frame.h>
#include <machine/trap.h>
#define BYTE_MSF (1)
typedef vm_offset_t db_addr_t;
typedef long db_expr_t;