xref: /netbsd-src/external/gpl3/gdb/dist/sim/lm32/cpu.c (revision 71f621822dbfd5073a314948bec169b7bb05f7be)
14e98e3e1Schristos /* Misc. support for CPU family lm32bf.
24e98e3e1Schristos 
34e98e3e1Schristos THIS FILE IS MACHINE GENERATED WITH CGEN.
44e98e3e1Schristos 
5*71f62182Schristos Copyright (C) 1996-2024 Free Software Foundation, Inc.
64e98e3e1Schristos 
74e98e3e1Schristos This file is part of the GNU simulators.
84e98e3e1Schristos 
94e98e3e1Schristos    This file is free software; you can redistribute it and/or modify
104e98e3e1Schristos    it under the terms of the GNU General Public License as published by
114e98e3e1Schristos    the Free Software Foundation; either version 3, or (at your option)
124e98e3e1Schristos    any later version.
134e98e3e1Schristos 
144e98e3e1Schristos    It is distributed in the hope that it will be useful, but WITHOUT
154e98e3e1Schristos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
164e98e3e1Schristos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
174e98e3e1Schristos    License for more details.
184e98e3e1Schristos 
194e98e3e1Schristos    You should have received a copy of the GNU General Public License along
20*71f62182Schristos    with this program; if not, write to the Free Software Foundation, Inc.,
21*71f62182Schristos    51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
224e98e3e1Schristos 
234e98e3e1Schristos */
244e98e3e1Schristos 
254e98e3e1Schristos #define WANT_CPU lm32bf
264e98e3e1Schristos #define WANT_CPU_LM32BF
274e98e3e1Schristos 
284e98e3e1Schristos #include "sim-main.h"
294e98e3e1Schristos #include "cgen-ops.h"
304e98e3e1Schristos 
314e98e3e1Schristos /* Get the value of h-pc.  */
324e98e3e1Schristos 
334e98e3e1Schristos USI
344e98e3e1Schristos lm32bf_h_pc_get (SIM_CPU *current_cpu)
354e98e3e1Schristos {
364e98e3e1Schristos   return CPU (h_pc);
374e98e3e1Schristos }
384e98e3e1Schristos 
394e98e3e1Schristos /* Set a value for h-pc.  */
404e98e3e1Schristos 
414e98e3e1Schristos void
424e98e3e1Schristos lm32bf_h_pc_set (SIM_CPU *current_cpu, USI newval)
434e98e3e1Schristos {
444e98e3e1Schristos   CPU (h_pc) = newval;
454e98e3e1Schristos }
464e98e3e1Schristos 
474e98e3e1Schristos /* Get the value of h-gr.  */
484e98e3e1Schristos 
494e98e3e1Schristos SI
504e98e3e1Schristos lm32bf_h_gr_get (SIM_CPU *current_cpu, UINT regno)
514e98e3e1Schristos {
524e98e3e1Schristos   return CPU (h_gr[regno]);
534e98e3e1Schristos }
544e98e3e1Schristos 
554e98e3e1Schristos /* Set a value for h-gr.  */
564e98e3e1Schristos 
574e98e3e1Schristos void
584e98e3e1Schristos lm32bf_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
594e98e3e1Schristos {
604e98e3e1Schristos   CPU (h_gr[regno]) = newval;
614e98e3e1Schristos }
624e98e3e1Schristos 
634e98e3e1Schristos /* Get the value of h-csr.  */
644e98e3e1Schristos 
654e98e3e1Schristos SI
664e98e3e1Schristos lm32bf_h_csr_get (SIM_CPU *current_cpu, UINT regno)
674e98e3e1Schristos {
684e98e3e1Schristos   return CPU (h_csr[regno]);
694e98e3e1Schristos }
704e98e3e1Schristos 
714e98e3e1Schristos /* Set a value for h-csr.  */
724e98e3e1Schristos 
734e98e3e1Schristos void
744e98e3e1Schristos lm32bf_h_csr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
754e98e3e1Schristos {
764e98e3e1Schristos   CPU (h_csr[regno]) = newval;
774e98e3e1Schristos }
78