X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.h;h=d7961313887bcd5795b488c7e6a03d52ffbaa87c;hb=4ab75a3634901c4e3897d771e2c75a64c7353c28;hp=5457f0abf63f2240f3b2a294b6312a10d2e899ed;hpb=e72b2601e71f49af10f72c4bb6220ee2061ef173;p=openocd.git diff --git a/src/target/target.h b/src/target/target.h index 5457f0abf6..d796131388 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -225,6 +225,13 @@ struct gdb_fileio_info { uint64_t param_4; }; +/** Returns a description of the endianness for the specified target. */ +static inline const char *target_endianness(struct target *target) +{ + return (target->endianness == TARGET_ENDIAN_UNKNOWN) ? "unknown" : + (target->endianness == TARGET_BIG_ENDIAN) ? "big endian" : "little endian"; +} + /** Returns the instance-specific name of the specified target. */ static inline const char *target_name(struct target *target) {