[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH rc3 05/30] target/avr: Introduce AVR features
From: |
Aleksandar Markovic |
Subject: |
[PATCH rc3 05/30] target/avr: Introduce AVR features |
Date: |
Sun, 26 Jan 2020 23:54:46 +0100 |
From: Michael Rolnik <address@hidden>
This patch introduces anumeration "AVRFeature" that will be
used for defining AVR core types.
Co-developed-by: Michael Rolnik <address@hidden>
Co-developed-by: Sarah Harris <address@hidden>
Signed-off-by: Michael Rolnik <address@hidden>
Signed-off-by: Sarah Harris <address@hidden>
Signed-off-by: Michael Rolnik <address@hidden>
Acked-by: Igor Mammedov <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
---
target/avr/cpu.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/target/avr/cpu.h b/target/avr/cpu.h
index b358e94..b74bcf0 100644
--- a/target/avr/cpu.h
+++ b/target/avr/cpu.h
@@ -69,6 +69,42 @@
#define EF_AVR_MACH 0x7F
+typedef enum AVRFeature {
+ AVR_FEATURE_SRAM,
+
+ AVR_FEATURE_1_BYTE_PC,
+ AVR_FEATURE_2_BYTE_PC,
+ AVR_FEATURE_3_BYTE_PC,
+
+ AVR_FEATURE_1_BYTE_SP,
+ AVR_FEATURE_2_BYTE_SP,
+
+ AVR_FEATURE_BREAK,
+ AVR_FEATURE_DES,
+ AVR_FEATURE_RMW, /* Read Modify Write - XCH LAC LAS LAT */
+
+ AVR_FEATURE_EIJMP_EICALL,
+ AVR_FEATURE_IJMP_ICALL,
+ AVR_FEATURE_JMP_CALL,
+
+ AVR_FEATURE_ADIW_SBIW,
+
+ AVR_FEATURE_SPM,
+ AVR_FEATURE_SPMX,
+
+ AVR_FEATURE_ELPMX,
+ AVR_FEATURE_ELPM,
+ AVR_FEATURE_LPMX,
+ AVR_FEATURE_LPM,
+
+ AVR_FEATURE_MOVW,
+ AVR_FEATURE_MUL,
+ AVR_FEATURE_RAMPD,
+ AVR_FEATURE_RAMPX,
+ AVR_FEATURE_RAMPY,
+ AVR_FEATURE_RAMPZ,
+} AVRFeature;
+
typedef struct CPUAVRState CPUAVRState;
struct CPUAVRState {
@@ -125,6 +161,16 @@ hwaddr avr_cpu_get_phys_page_debug(CPUState *cpu, vaddr
addr);
int avr_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
int avr_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+static inline int avr_feature(CPUAVRState *env, AVRFeature feature)
+{
+ return (env->features & (1U << feature)) != 0;
+}
+
+static inline void avr_set_feature(CPUAVRState *env, int feature)
+{
+ env->features |= (1U << feature);
+}
+
#define cpu_list avr_cpu_list
#define cpu_signal_handler cpu_avr_signal_handler
#define cpu_mmu_index avr_cpu_mmu_index
--
2.7.4
- [PATCH rc3 00/30] target/avr merger, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 05/30] target/avr: Introduce AVR features,
Aleksandar Markovic <=
- [PATCH rc3 08/30] target/avr: Add instruction translation - Registers definition, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 07/30] target/avr: Add instruction helpers, Aleksandar Markovic, 2020/01/26
- [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Aleksandar Markovic, 2020/01/26
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Michael Rolnik, 2020/01/27
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Michael Rolnik, 2020/01/28
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Aleksandar Markovic, 2020/01/28
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Michael Rolnik, 2020/01/28
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Aleksandar Markovic, 2020/01/28
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Philippe Mathieu-Daudé, 2020/01/29
- Re: [PATCH rc3 01/30] target/avr: Add basic parameters for new AVR platform, Aleksandar Markovic, 2020/01/29