Skip to content

Commit

Permalink
Initial add of tree library and basrun for Legos. #596
Browse files Browse the repository at this point in the history
  • Loading branch information
Falk Rehwagen committed Jul 12, 2024
1 parent 978ab36 commit 3398446
Show file tree
Hide file tree
Showing 12 changed files with 1,425 additions and 12 deletions.
14 changes: 14 additions & 0 deletions Library/Legos/Basrun/Basrun/basrunManager.asm
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ RunHeapIncRef_asm proc far
pushdw dxax
ifdef __BORLANDC__
call _RunHeapIncRef
elifdef __WATCOMC__
call _RunHeapIncRef
else
call RunHeapIncRef
endif
Expand Down Expand Up @@ -626,6 +628,8 @@ RunHeapDecRef_asm proc far
pushdw dxax
ifdef __BORLANDC__
call _RunHeapDecRef
elifdef __WATCOMC__
call _RunHeapDecRef
else
call RunHeapDecRef
endif
Expand Down Expand Up @@ -678,6 +682,8 @@ RunHeapAlloc_asm proc far
movdw ss:[bp].RHAS_data, esdi
ifdef __BORLANDC__
call _RunHeapAlloc
elifdef __WATCOMC__
call _RunHeapAlloc
else
call RunHeapAlloc
endif
Expand Down Expand Up @@ -728,6 +734,8 @@ RunHeapLock_asm proc far
movdw ss:[bp].RHLS_dataPtr, ssax
ifdef __BORLANDC__
call _RunHeapLockExternal
elifdef __WATCOMC__
call _RunHeapLockExternal
else
call RunHeapLockExternal
endif
Expand Down Expand Up @@ -777,6 +785,8 @@ RunHeapUnlock_asm proc far
mov ss:[bp].RHLS_token, bx
ifdef __BORLANDC__
call _RunHeapUnlockExternal
elifdef __WATCOMC__
call _RunHeapUnlockExternal
else
call RunHeapUnlockExternal
endif
Expand Down Expand Up @@ -822,6 +832,8 @@ RunComponentLockHeap_asm proc far
pushdw dsax
ifdef __BORLANDC__
call _RunComponentLockHeap
elifdef __WATCOMC__
call _RunComponentLockHeap
else
call RunComponentLockHeap
endif
Expand Down Expand Up @@ -860,6 +872,8 @@ RunComponentUnlockHeap_asm proc far
pushdw dsax
ifdef __BORLANDC__
call _RunComponentUnlockHeap
elifdef __WATCOMC__
call _RunComponentUnlockHeap
else
call RunComponentUnlockHeap
endif
Expand Down
18 changes: 9 additions & 9 deletions Library/Legos/Basrun/Basrun/comp.goc
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ RTaskHan theSystemModule = NULL;
#ifndef LIBERTY
/* Sometimes I tire of using 0xffff all the time */
#define GET_NEW_BLOCK 0xfffd
static MemHandle GetUiBlock(RunTask* rtask, MemHandle desiredHan);
MemHandle GetUiBlock(RunTask* rtask, MemHandle desiredHan);

static void RunCreateBTAggregateComponent
void RunCreateBTAggregateComponent
(RMLPtr rms, RTaskHan aggLib, word funcNum, optr parentOptr,
RunHeapToken nameTok);

Expand All @@ -95,14 +95,14 @@ extern RunDoBCActionLow(RunHeapInfo *rhi, optr comp, void *retval,

extern void RunCreateAggregateComponent(RMLPtr rms, RTaskHan aggLib,
word funcNum, optr parentOptr);
static void INT_ON_Local(RMLPtr rms);
static void INT_OFF_Local(RMLPtr rms);
void INT_ON_Local(RMLPtr rms);
void INT_OFF_Local(RMLPtr rms);


static void INT_ON_Local(RMLPtr rms) {
void INT_ON_Local(RMLPtr rms) {
INT_ON(rms);
}
static void INT_OFF_Local(RMLPtr rms) {
void INT_OFF_Local(RMLPtr rms) {
INT_OFF(rms);
}

Expand Down Expand Up @@ -237,7 +237,7 @@ void RunSendMessage(optr dest, word msg) {
* If both tries fail, create a new block.
*
*********************************************************************/
static MemHandle GetUiBlock(RunTask* rtask, MemHandle desiredHan)
MemHandle GetUiBlock(RunTask* rtask, MemHandle desiredHan)
{
word i, count;
MemHandle mh = NullHandle;
Expand Down Expand Up @@ -333,7 +333,7 @@ getFirst:
/* FIXME since this is build-time only, it can be moved to
* a different code segment.
*/
static void
void
RunCreateBTAggregateComponent(RMLPtr rms, RTaskHan aggLib,
word funcNum, optr parentOptr,
RunHeapToken nameTok)
Expand Down Expand Up @@ -647,7 +647,7 @@ IACPCreateDefaultLaunchBlock(MSG_GEN_PROCESS_OPEN_APPLICATION);
/*
* GEOS version
*/
static void
void
RunCreateComponent(RMLPtr rms, optr parentOptr, RunHeapToken nameTok)
{
Boolean isForm;
Expand Down
18 changes: 18 additions & 0 deletions Library/Legos/Basrun/Basrun/heapint.def
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ global _RunHeapDecRef:far
RUNHEAP_TEXT ends
endif

ifdef __WATCOMC__
global _RunHeapAlloc:far
global _RunHeapLockExternal:far
global _RunHeapUnlockExternal:far
global _RunHeapIncRef:far
global _RunHeapDecRef:far
endif

ifdef __HIGHC__
; link to routines defined in a C .obj
global RunHeapAlloc:far
Expand All @@ -44,10 +52,20 @@ endif

;EC < COMP_E_TEXT segment public "CODE" byte >
;NEC < COMP_G_TEXT segment public "CODE" byte >
ifdef __BORLANDC__
COMP_TEXT segment public "CODE" byte
global _RunComponentLockHeap:far
global _RunComponentUnlockHeap:far
COMP_TEXT ends
elifdef __WATCOMC__
comp_TEXT segment public "CODE" byte
global _RunComponentLockHeap:far
global _RunComponentUnlockHeap:far
comp_TEXT ends
else
global RunComponentLockHeap:far
global RunComponentUnlockHeap:far
endif
;NEC < COMP_G_TEXT ends >
;EC < COMP_E_TEXT ends >

Expand Down
2 changes: 1 addition & 1 deletion Library/Legos/Basrun/Basrun/rheapint.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ LRunHeapEnum(RunHeapType rht, RunHeapCB callback, void* extra_data);
#define TOKEN_TO_CHUNK(x) \
((TOKEN_BKEY(x) << 1) + sizeof(LMemBlockHeader))

#define CHUNK_TO_BKEY(x) (((x) - sizeof(LMemBlockHeader)) >> 1)
#define CHUNK_TO_BKEY(x) ((((word) x) - sizeof(LMemBlockHeader)) >> 1)
#define SAME_HEAP_BLOCK(x,y) (TOKEN_SEG(x) == TOKEN_SEG(y))


Expand Down
2 changes: 2 additions & 0 deletions Library/Legos/Basrun/Fidomain/mmodule.asm
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ _Fido_MakeMLCanonical proc near
push ax
ifdef __BORLANDC__
call FIDO_MAKEMLCANONICAL
elifdef __WATCOMC__
call FIDO_MAKEMLCANONICAL
else
call Fido_MakeMLCanonical
endif
Expand Down
4 changes: 3 additions & 1 deletion Library/Legos/Basrun/basrun.gp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ library hash
#library fido
library streamc

resource RUNERRORSTRINGS lmem shared read-only
library borlandc

resource RunErrorStrings lmem shared read-only

export InterpClass

Expand Down
2 changes: 2 additions & 0 deletions Library/Legos/Basrun/fidoint.def
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ ifdef __BORLANDC__
FIDOUTIL_TEXT segment public byte "CODE"
global FIDO_MAKEMLCANONICAL:far
FIDOUTIL_TEXT ends
elifdef __WATCOMC__
global FIDO_MAKEMLCANONICAL:far
else ;__HIGHC__
global Fido_MakeMLCanonical:far
endif
Expand Down
3 changes: 2 additions & 1 deletion Library/Legos/Basrun/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ GOCFLAGS += -Ha -D__BORLANDC__
ASMFLAGS += -DREAD_CHECK -DWRITE_CHECK -wjmp
ASMFLAGS += -DBASRUN_GLUE_BUG
#ASMFLAGS += -D__HIGHC__
ASMFLAGS += -D__BORLANDC__
#ASMFLAGS += -D__BORLANDC__
ASMFLAGS += -D__WATCOMC__
59 changes: 59 additions & 0 deletions Library/Tree/errors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT:
MODULE:
FILE: errors.h
AUTHOR: Roy Goldman, Dec 9, 1994
REVISION HISTORY:
Name Date Description
---- ---- -----------
roy 12/ 9/94 Initial version.
DESCRIPTION:
Swat errors for tree library
$Id: errors.h,v 1.1 97/05/30 08:20:05 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifndef _ERRORS_H_
#define _ERRORS_H_

#include <ec.h>

typedef enum {

/* Your node has been allocated with too many children */
TOO_MANY_CHILD_SLOTS,

/* Illegal parameters to a library routine */
ILLEGAL_PARAMETERS,

/* Try to do useful operations on a NullNode */
NULL_NODE,

/* Try to reference a child which doesn't exist */
BAD_CHILD_SPECIFIER,

/* Integrity of children data has been undermined */
CHILDREN_MESSED_UP,

/* Illegal node reference */
ILLEGAL_INDEX,

/* Circular dependency in tree */
CIRCULAR_DEPENDENCY,
} FatalErrors;

typedef enum {
/* Give a warning when a single node in a tree
is starting to get full */

WARN_NODE_LARGER_THAN_6K
} Warnings;


#endif /* _ERRORS_H_ */
Loading

0 comments on commit 3398446

Please sign in to comment.