2022-06-26 23:24:07 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2008-07-26 10:32:11 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2008 by Spencer Oliver *
|
|
|
|
* spen@spen-soft.co.uk *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2008 by David T.L. Wong *
|
|
|
|
* *
|
2011-07-07 15:41:20 +00:00
|
|
|
* Copyright (C) 2011 by Drasko DRASKOVIC *
|
|
|
|
* drasko.draskovic@gmail.com *
|
2008-07-26 10:32:11 +00:00
|
|
|
***************************************************************************/
|
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#ifndef OPENOCD_TARGET_MIPS_M4K_H
|
|
|
|
#define OPENOCD_TARGET_MIPS_M4K_H
|
2008-07-26 10:32:11 +00:00
|
|
|
|
2009-11-13 18:11:13 +00:00
|
|
|
struct target;
|
2008-07-26 10:32:11 +00:00
|
|
|
|
2022-05-26 08:01:45 +00:00
|
|
|
#define MIPSM4K_COMMON_MAGIC 0xB321B321U
|
2008-07-26 10:32:11 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct mips_m4k_common {
|
2022-05-26 08:01:45 +00:00
|
|
|
unsigned int common_magic;
|
|
|
|
|
2010-03-16 12:48:53 +00:00
|
|
|
struct mips32_common mips32;
|
2022-05-26 14:25:34 +00:00
|
|
|
|
|
|
|
bool is_pic32mx;
|
2009-11-13 16:43:39 +00:00
|
|
|
};
|
2008-07-26 10:32:11 +00:00
|
|
|
|
2010-01-08 22:35:08 +00:00
|
|
|
static inline struct mips_m4k_common *
|
|
|
|
target_to_m4k(struct target *target)
|
|
|
|
{
|
|
|
|
return container_of(target->arch_info,
|
2010-03-16 12:48:53 +00:00
|
|
|
struct mips_m4k_common, mips32);
|
2010-01-08 22:35:08 +00:00
|
|
|
}
|
|
|
|
|
2017-05-07 16:39:17 +00:00
|
|
|
static inline void mips_m4k_isa_filter(enum mips32_isa_imp isa_imp, target_addr_t *addr)
|
|
|
|
{
|
|
|
|
if (isa_imp <= 1) { /* if only one isa implemented */
|
|
|
|
target_addr_t address = (*addr & ~1) | isa_imp;
|
|
|
|
|
|
|
|
if (address != *addr) {
|
|
|
|
LOG_USER("Warning: isa bit changed due to isa not implemented");
|
|
|
|
*addr = address;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-07-07 15:41:20 +00:00
|
|
|
extern const struct command_registration mips_m4k_command_handlers[];
|
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#endif /* OPENOCD_TARGET_MIPS_M4K_H */
|