From nobody Tue Feb 10 06:44:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1580079481; cv=none; d=zohomail.com; s=zohoarc; b=HBSG/jd+xq5Twmq6BaMjpJ+6l3BAsAZeLrCSNI/n+2h382KdMo1rZ8NYy73kpXO7niHKR7HfHybH3Zm29IwiED1CQ01GhbSdZwqZs9qFHPta5e4WqOGy0G61A32vinXureeO7c9TWsbu5/Oqv9wDFnzmT643vyXxIgPu96hkAJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1580079481; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IiQiW31lURl2qpS/gl/SbCmuLDVqjWEzGZiv9D8dmmo=; b=GIlaa3olsvQIQuZlg/pZgvAM8wt+hEvSpkCZWo5f+NagsHMINvp0eSZOV10RaKmmB8Vt5P+UTIhkmySKjani3hI+OI6m/gpE/I+fz2KosnlRtOkZcpcsTwENTBjmdhMcAIQa71sJ0C22V+j72E1CKb4dM4xWpTunQ8Qkwkwx6W4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1580079481579717.2570087612879; Sun, 26 Jan 2020 14:58:01 -0800 (PST) Received: from localhost ([::1]:37916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivqqt-0007DI-JD for importer@patchew.org; Sun, 26 Jan 2020 17:57:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33325) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivqpk-0005UG-P7 for qemu-devel@nongnu.org; Sun, 26 Jan 2020 17:56:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ivqpj-0000M6-OV for qemu-devel@nongnu.org; Sun, 26 Jan 2020 17:56:48 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:37940 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ivqpj-0000LM-HE for qemu-devel@nongnu.org; Sun, 26 Jan 2020 17:56:47 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 6FEEF1A1D2D; Sun, 26 Jan 2020 23:55:51 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 5628D1A1D20; Sun, 26 Jan 2020 23:55:51 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH rc3 05/30] target/avr: Introduce AVR features Date: Sun, 26 Jan 2020 23:54:46 +0100 Message-Id: <1580079311-20447-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580079311-20447-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1580079311-20447-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Sarah Harris , Michael Rolnik , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Michael Rolnik This patch introduces anumeration "AVRFeature" that will be used for defining AVR core types. Co-developed-by: Michael Rolnik Co-developed-by: Sarah Harris Signed-off-by: Michael Rolnik Signed-off-by: Sarah Harris Signed-off-by: Michael Rolnik Acked-by: Igor Mammedov Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Signed-off-by: Aleksandar Markovic --- 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 @@ =20 #define EF_AVR_MACH 0x7F =20 +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; =20 struct CPUAVRState { @@ -125,6 +161,16 @@ hwaddr avr_cpu_get_phys_page_debug(CPUState *cpu, vadd= r 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); =20 +static inline int avr_feature(CPUAVRState *env, AVRFeature feature) +{ + return (env->features & (1U << feature)) !=3D 0; +} + +static inline void avr_set_feature(CPUAVRState *env, int feature) +{ + env->features |=3D (1U << feature); +} + #define cpu_list avr_cpu_list #define cpu_signal_handler cpu_avr_signal_handler #define cpu_mmu_index avr_cpu_mmu_index --=20 2.7.4