4 ; Handling of DLL workspace and similar things
9 ;----- Standard stuff -------------------------------------------------------
14 ;----- Other external dependencies ------------------------------------------
16 IMPORT |x$stack_overflow|
19 IMPORT |__errno|,WEAK ;Vile hack :-(
21 ;----- Main code ------------------------------------------------------------
23 AREA |DLL$$Code|,CODE,READONLY
25 ; --- _dll_giveMemory ---
27 EXPORT |_dll_giveMemory|
28 |_dll_giveMemory| ROUT
31 STMFD sp!,{v1,fp,ip,lr,pc}
34 BLLT |x$stack_overflow|
36 MOV v1,#0 ;Start with magic number at 0
37 00 SWI DLL_InstanceVars ;Give DLL some variables
38 CMP v1,#0 ;Is this the end yet?
39 LDMEQDB fp,{v1,fp,sp,pc}^ ;Yes -- return to caller
40 BL malloc ;Allocate variables as reqd.
41 B %b00 ;And give to the DLL
45 ; --- _dll_appspace ---
47 EXPORT |_dll_appspace|
50 MOV ip,lr ;Keep hold of link register
51 MOV a1,sl ;Point to stack limit thingy
52 SWI DLL_AppData ;Tell DLLManager about this
53 MOVS pc,ip ;Return to caller
57 ; --- _dll_clibdata ---
59 EXPORT |_dll_clibdata|
62 MOV ip,lr ;Keep link register safe
63 LDR a1,=|__errno| ;Find the C Library's space
64 SWI DLL_GiveCLibData ;Pass on the CLib data
65 MOVS pc,ip ;Return to caller
69 ;----- That's all, folks ----------------------------------------------------