2 * Simulator of microcontrollers (sim.src/itsrccl.h)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
28 #ifndef SIM_ITSRCCL_HEADER
29 #define SIM_ITSRCCL_HEADER
36 * Represents source of interrupt
39 class cl_it_src: public cl_base
43 uchar ie_mask; // Mask in IE register
44 uchar src_reg; // Register in SFR of source
45 uchar src_mask; // Mask of source bit in src_reg
46 uint addr; // Address of service routine
47 bool clr_bit; // Request bit must be cleared when IT accepted
48 //char *name; // For debug
49 bool active; // Acceptance can be disabled
51 cl_it_src(uchar Iie_mask,
58 virtual ~cl_it_src(void);
61 virtual void set_active_status(bool Aactive);
62 virtual void activate(void);
63 virtual void deactivate(void);
67 class cl_irqs: public cl_sorted_list
70 cl_irqs(t_index alimit, t_index adelta);
71 virtual const void *key_of(void *item);
72 virtual int compare(const void *key1, const void *key2);
77 * This class is used to follow levels of accepted interrupts
78 * It used on a stack of active interrupt services (it_levels of cl_uc)
81 class it_level: public cl_base
87 class cl_it_src *source;
89 it_level(int alevel, uint aaddr, uint aPC, class cl_it_src *is);
95 /* End of itsrccl.h */