Call ARMDeinit
Jeffrey Pfau jeffrey@endrift.com
Sun, 20 Apr 2014 00:52:37 -0700
4 files changed,
15 insertions(+),
0 deletions(-)
M
src/arm/arm.c
→
src/arm/arm.c
@@ -72,6 +72,18 @@ cpu->components[i]->init(cpu, cpu->components[i]);
} } +void ARMDeinit(struct ARMCore* cpu) { + if (cpu->master->deinit) { + cpu->master->deinit(cpu->master); + } + int i; + for (i = 0; i < cpu->numComponents; ++i) { + if (cpu->components[i]->deinit) { + cpu->components[i]->deinit(cpu->components[i]); + } + } +} + void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras) { // TODO: Call init/deinit cpu->master = master;
M
src/arm/arm.h
→
src/arm/arm.h
@@ -145,6 +145,7 @@ struct ARMComponent** components;
}; void ARMInit(struct ARMCore* cpu); +void ARMDeinit(struct ARMCore* cpu); void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras); void ARMReset(struct ARMCore* cpu);
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -154,6 +154,7 @@ threadContext->cleanCallback(threadContext);
} threadContext->gba = 0; + ARMDeinit(&cpu); GBADestroy(&gba); ConditionWake(&threadContext->sync.videoFrameAvailableCond);
M
src/gba/gba.c
→
src/gba/gba.c
@@ -102,6 +102,7 @@
void GBACreate(struct GBA* gba) { gba->d.id = GBA_COMPONENT_MAGIC; gba->d.init = GBAInit; + gba->d.deinit = 0; } static void GBAInit(struct ARMCore* cpu, struct ARMComponent* component) {