136c1118dSDaniel Henrique Barboza /* 236c1118dSDaniel Henrique Barboza * riscv TCG cpu class initialization 336c1118dSDaniel Henrique Barboza * 436c1118dSDaniel Henrique Barboza * Copyright (c) 2023 Ventana Micro Systems Inc. 536c1118dSDaniel Henrique Barboza * 636c1118dSDaniel Henrique Barboza * This library is free software; you can redistribute it and/or 736c1118dSDaniel Henrique Barboza * modify it under the terms of the GNU Lesser General Public 836c1118dSDaniel Henrique Barboza * License as published by the Free Software Foundation; either 936c1118dSDaniel Henrique Barboza * version 2 of the License, or (at your option) any later version. 1036c1118dSDaniel Henrique Barboza * 1136c1118dSDaniel Henrique Barboza * This library is distributed in the hope that it will be useful, 1236c1118dSDaniel Henrique Barboza * but WITHOUT ANY WARRANTY; without even the implied warranty of 1336c1118dSDaniel Henrique Barboza * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1436c1118dSDaniel Henrique Barboza * Lesser General Public License for more details. 1536c1118dSDaniel Henrique Barboza * 1636c1118dSDaniel Henrique Barboza * You should have received a copy of the GNU Lesser General Public 1736c1118dSDaniel Henrique Barboza * License along with this library; if not, see <http://www.gnu.org/licenses/>. 1836c1118dSDaniel Henrique Barboza */ 1936c1118dSDaniel Henrique Barboza 2036c1118dSDaniel Henrique Barboza #ifndef RISCV_TCG_CPU_H 2136c1118dSDaniel Henrique Barboza #define RISCV_TCG_CPU_H 2236c1118dSDaniel Henrique Barboza 2336c1118dSDaniel Henrique Barboza #include "cpu.h" 2436c1118dSDaniel Henrique Barboza 2536c1118dSDaniel Henrique Barboza void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp); 26a13a6082SDaniel Henrique Barboza void riscv_tcg_cpu_finalize_features(RISCVCPU *cpu, Error **errp); 27ef58fad0SDaniel Henrique Barboza bool riscv_cpu_tcg_compatible(RISCVCPU *cpu); 2836c1118dSDaniel Henrique Barboza 29*f50d0f33SPhilippe Mathieu-Daudé extern const TCGCPUOps riscv_tcg_ops; 30*f50d0f33SPhilippe Mathieu-Daudé 318c8a7cd6SHuang Tao struct DisasContext; 328c8a7cd6SHuang Tao struct RISCVCPUConfig; 338c8a7cd6SHuang Tao typedef struct RISCVDecoder { 348c8a7cd6SHuang Tao bool (*guard_func)(const struct RISCVCPUConfig *); 358c8a7cd6SHuang Tao bool (*riscv_cpu_decode_fn)(struct DisasContext *, uint32_t); 368c8a7cd6SHuang Tao } RISCVDecoder; 378c8a7cd6SHuang Tao 388c8a7cd6SHuang Tao typedef bool (*riscv_cpu_decode_fn)(struct DisasContext *, uint32_t); 398c8a7cd6SHuang Tao 408c8a7cd6SHuang Tao extern const size_t decoder_table_size; 418c8a7cd6SHuang Tao 428c8a7cd6SHuang Tao extern const RISCVDecoder decoder_table[]; 438c8a7cd6SHuang Tao 448c8a7cd6SHuang Tao void riscv_tcg_cpu_finalize_dynamic_decoder(RISCVCPU *cpu); 458c8a7cd6SHuang Tao 4636c1118dSDaniel Henrique Barboza #endif 47