cores: Now duplicate the global structure
[simavr] / simavr / cores / sim_mega168.c
index 54d8bcf..70f1b4e 100644 (file)
@@ -19,7 +19,7 @@
        along with simavr.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "simavr.h"
+#include "sim_avr.h"
 
 #define SIM_VECTOR_SIZE        4
 #define SIM_MMCU               "atmega168"
@@ -33,7 +33,7 @@
 
 static avr_t * make()
 {
-       return &SIM_CORENAME.core;
+       return avr_core_allocate(&SIM_CORENAME.core, sizeof(struct mcu_t));
 }
 
 avr_kind_t mega168 = {