1 #ifndef DOS_SEGTRACKER_H 2 #define DOS_SEGTRACKER_H 3 4 /* 5 dos.library segtracker include 6 7 Copyright © 2002 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_TYPES_H 11 # include <exec/types.h> 12 #endif 13 14 #ifndef EXEC_SEMAPHORES_H 15 # include <exec/semaphores.h> 16 #endif 17 18 19 #pragma pack(2) 20 21 22 #define SEG_SEM "SegTracker" 23 24 25 /* 26 * The SegTracker seg_Find function calling convention: 27 * 28 * STRPTR seg_Find(ULONG Address, ULONG *SegNum, ULONG *Offset) 29 * D0 A0 A1 A2 30 * 31 * For given 'Address' seg_Find returns NULL or the segment name. 32 * If non-NULL is returned, ULONG pointed by 'SegNum' and 'Offset' 33 * hold the segment number and the offset within this segment. 34 * To get seglist pointer, pass same pointer to 'SegNum' and 35 * 'Offset'. 36 */ 37 38 /* 39 * NOTE: For native MorphOS code you should use sysdebug.library 40 * SysDebugFindSeg(), it has the same prototype as above, but uses 41 * native calling convention instead (and no semaphore-locking is 42 * required). 43 */ 44 45 struct SegSem 46 { 47 struct SignalSemaphore seg_Semaphore; 48 STRPTR (*seg_Find)(VOID); 49 /* Do not make any assumption about other content of 50 this structure. */ 51 }; 52 53 54 #pragma pack() 55 56 #endif /* DOS_SEGTRACKER_H */