Move various embedded target structs to the beginnings of
their containers ... pretty much the way C++ or Obj-C
would for single inheritance.
This shrinks code that accesses those embedded structs by
letting common offsets use smaller instructions. Sample
before/after sizes (on amd64):
17181 312 0 17493 4455 arm920t.o
16810 312 0 17122 42e2 arm920t.o
Where the "after" is the smaller number, with this patch
over the ones leveraging that embedding knowledge.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
typedef struct arm720t_common_s
{
typedef struct arm720t_common_s
{
+ arm7tdmi_common_t arm7tdmi_common;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
- arm7tdmi_common_t arm7tdmi_common;
uint32_t cp15_control_reg;
uint32_t fsr_reg;
uint32_t far_reg;
uint32_t cp15_control_reg;
uint32_t fsr_reg;
uint32_t far_reg;
*/
typedef struct arm7_9_common_s
{
*/
typedef struct arm7_9_common_s
{
+ armv4_5_common_t armv4_5_common;
uint32_t common_magic;
arm_jtag_t jtag_info; /**< JTAG information for target */
uint32_t common_magic;
arm_jtag_t jtag_info; /**< JTAG information for target */
void (*pre_restore_context)(target_t *target); /**< Callback function called before restoring the processor context */
void (*post_restore_context)(target_t *target); /**< Callback function called after restoring the processor context */
void (*pre_restore_context)(target_t *target); /**< Callback function called before restoring the processor context */
void (*post_restore_context)(target_t *target); /**< Callback function called after restoring the processor context */
- armv4_5_common_t armv4_5_common;
typedef struct arm920t_common_s
{
typedef struct arm920t_common_s
{
+ arm9tdmi_common_t arm9tdmi_common;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
- arm9tdmi_common_t arm9tdmi_common;
uint32_t cp15_control_reg;
uint32_t d_fsr;
uint32_t i_fsr;
uint32_t cp15_control_reg;
uint32_t d_fsr;
uint32_t i_fsr;
typedef struct arm926ejs_common_s
{
typedef struct arm926ejs_common_s
{
+ arm9tdmi_common_t arm9tdmi_common;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
uint32_t common_magic;
armv4_5_mmu_common_t armv4_5_mmu;
- arm9tdmi_common_t arm9tdmi_common;
int (*read_cp15)(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
int (*write_cp15)(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value);
uint32_t cp15_control_reg;
int (*read_cp15)(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
int (*write_cp15)(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value);
uint32_t cp15_control_reg;
typedef struct arm966e_common_s
{
typedef struct arm966e_common_s
{
arm9tdmi_common_t arm9tdmi_common;
arm9tdmi_common_t arm9tdmi_common;
uint32_t cp15_control_reg;
} arm966e_common_t;
uint32_t cp15_control_reg;
} arm966e_common_t;
typedef struct xscale_common_s
{
typedef struct xscale_common_s
{
+ /* armv4/5 common stuff */
+ armv4_5_common_t armv4_5_common;
+
int common_magic;
/* XScale registers (CP15, DBG) */
int common_magic;
/* XScale registers (CP15, DBG) */
- /* armv4/5 common stuff */
- armv4_5_common_t armv4_5_common;
-
/* MMU/Caches */
armv4_5_mmu_common_t armv4_5_mmu;
uint32_t cp15_control_reg;
/* MMU/Caches */
armv4_5_mmu_common_t armv4_5_mmu;
uint32_t cp15_control_reg;
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)