1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-11 23:43:19 +00:00

Move extern declaration for IOINTERRUPTFLAGS_word to lspglob.h and remove from initsout.c

Initialize MaxTypeNumber_word from address of value cell of \MaxTypeNumber in initsout.c
Correctly extract value of \MaxTypeNumber where used in gcmaptable() (though gcmaptable() itself is unused at this time)
Update GetDTD() macro to return (void *), result will be cast to (struct dtd *) where it is needed.  Alignment should always be sufficiently large.
This commit is contained in:
Nick Briggs 2023-01-07 14:39:53 -08:00
parent 6158162b62
commit 6603957a0b
4 changed files with 9 additions and 5 deletions

View File

@ -145,6 +145,7 @@ extern LispPTR *LeastMDSPage_word;
extern LispPTR *SecondMDSPage_word;
extern LispPTR *SecondArrayPage_word;
extern LispPTR *INTERRUPTSTATE_word;
extern LispPTR *IOINTERRUPTFLAGS_word;
extern LispPTR *SYSTEMCACHEVARS_word;
extern LispPTR *MACHINETYPE_word;

View File

@ -617,9 +617,9 @@ typedef struct
/* Get DTD pointer(68k) from typenum */
#ifdef BIGVM
#define GetDTD(typnum) (DTDspace + ((typnum)<<4)+((typnum)<<1))
#define GetDTD(typnum) (void *)(DTDspace + ((typnum)<<4)+((typnum)<<1))
#else
#define GetDTD(typnum) (DTDspace + ((typnum)<<4))
#define GetDTD(typnum) (void *)(DTDspace + ((typnum)<<4))
#endif /* BIGVM */
/* Get all type entry */

View File

@ -29,11 +29,12 @@
#include "version.h"
#include "arith.h" // for GetSmalldata
#include "gcdata.h" // for htoverflow, REC_GCLOOKUP
#include "gcoflowdefs.h" // for gc_handleoverflow, gcmaptable
#include "gcrdefs.h" // for doreclaim
#include "lispemul.h" // for NIL, DLword, LispPTR
#include "lspglob.h" // for Reclaim_cnt_word, HToverflow, MaxTypeNumber...
#include "lspglob.h" // for Reclaim_cnt_word, HToverflow, MaxTypeNumber_word
#include "lsptypes.h" // for dtd, GetDTD, TYPE_LISTP
#define Increment_Allocation_Count(n) \
@ -77,6 +78,8 @@ DLword gcmaptable(DLword arg) {
LispPTR cellcnt;
int typnum;
LispPTR addr;
int maxtypenumber = GetSmalldata(*MaxTypeNumber_word);
cell = (struct htoverflow *)HToverflow;
/* This proc. protected from interrupt */
while ((addr = cell->ptr) != NIL) {
@ -85,7 +88,7 @@ DLword gcmaptable(DLword arg) {
cell->pcase = 0;
++cell; /* (\ADDBASE CELL WORDSPERCELL) */
}
for (typnum = 1; typnum <= *MaxTypeNumber_word; ++typnum)
for (typnum = 1; typnum <= maxtypenumber; ++typnum)
/* applied alltype */
{
ptr = (struct dtd *)GetDTD(typnum);

View File

@ -331,6 +331,7 @@ void build_lisp_map(void) {
Next_MDSpage_word = fixp_value(MakeAtom68k("\\NxtMDSPage"));
Next_Array_word = fixp_value(MakeAtom68k("\\NxtArrayPage"));
MDS_free_page_word = MakeAtom68k("\\MDSFREELISTPAGE");
MaxTypeNumber_word = MakeAtom68k("\\MaxTypeNumber");
/*** The following are STK-OVER-FLOW stuff * Take **/
STACKOVERFLOW_word = MakeAtom68k("\\STACKOVERFLOW");
@ -385,7 +386,6 @@ void init_for_keyhandle(void) {
extern LispPTR *PERIODIC_INTERRUPT68k;
extern LispPTR *PERIODIC_INTERRUPT_FREQUENCY68k;
extern LispPTR *IOINTERRUPTFLAGS_word;
CURSORDESTHEIGHT68k = MakeAtom68k("\\CURSORDESTHEIGHT");
CURSORDESTWIDTH68k = MakeAtom68k("\\CURSORDESTWIDTH");