Changeset 1984
- Timestamp:
- May 8, 2005, 2:11:22 PM (20 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/ChangeLog.LIBC
-
Property cvs2svn:cvs-rev
changed from
1.44
to1.45
r1983 r1984 1 1 /* $Id$ */ 2 3 2005-05-08: knut st. osmundsen <bird-gccos2-spam@anduin.net> 4 - libc: 5 o Added _getenv_[int|long|longlong]. Using this for LIBC_THREAD_MIN_STACK_SIZE. 6 o Ported the BSD SysV Semaphore module. 7 o Added a signal notification callback to the thread structure. 8 o Changed tcpip term callback to more generic exitlist callback (SPM). 2 9 3 10 2005-05-05: knut st. osmundsen <bird-gccos2-spam@anduin.net> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/386/builtin.h
-
Property cvs2svn:cvs-rev
changed from
1.10
to1.11
r1983 r1984 77 77 static __inline__ int __atomic_set_bit(__volatile__ void *pv, unsigned uBit) 78 78 { 79 __asm__ __volatile__("lock btsl %2, %1\n\t"79 __asm__ __volatile__("lock; btsl %2, %1\n\t" 80 80 "sbbl %0,%0" 81 81 : "=r" (uBit), … … 95 95 static __inline__ void __atomic_clear_bit(__volatile__ void *pv, unsigned uBit) 96 96 { 97 __asm__ __volatile__("lock btrl %1, %0"97 __asm__ __volatile__("lock; btrl %1, %0" 98 98 : "=m" (*(__volatile__ unsigned *)pv) 99 99 : "r" (uBit)); … … 128 128 static __inline__ void __atomic_add(__volatile__ unsigned *pu, const unsigned uAdd) 129 129 { 130 __asm__ __volatile__("lock addl %1, %0"130 __asm__ __volatile__("lock; addl %1, %0" 131 131 : "=m" (*pu) 132 : "nr" (uAdd), 132 : "nr" (uAdd), 133 133 "m" (*pu)); 134 134 } … … 142 142 static __inline__ void __atomic_sub(__volatile__ unsigned *pu, const unsigned uSub) 143 143 { 144 __asm__ __volatile__("lock subl %1, %0"144 __asm__ __volatile__("lock; subl %1, %0" 145 145 : "=m" (*pu) 146 : "nr" (uSub), 146 : "nr" (uSub), 147 147 "m" (*pu)); 148 148 } … … 156 156 static __inline__ void __atomic_increment(__volatile__ unsigned *pu) 157 157 { 158 __asm__ __volatile__("lock incl %0"159 : "=m" (*pu) 158 __asm__ __volatile__("lock; incl %0" 159 : "=m" (*pu) 160 160 : "m" (*pu)); 161 161 } 162 162 163 163 /** 164 * Atomically increments a 32-bit unsigned value. 165 * 166 * @param pu32 Pointer to the value to increment. 167 */ 168 static __inline__ void __atomic_increment_u32(uint32_t __volatile__ *pu32) 169 { 170 __asm__ __volatile__("lock; incl %0" 171 : "=m" (*pu32) 172 : "m" (*pu32)); 173 } 174 175 /** 176 * Atomically increments a 16-bit unsigned value. 177 * 178 * @param pu16 Pointer to the value to increment. 179 */ 180 static __inline__ void __atomic_increment_u16(uint16_t __volatile__ *pu16) 181 { 182 __asm__ __volatile__("lock; incw %0" 183 : "=m" (*pu16) 184 : "m" (*pu16)); 185 } 186 187 /** 164 188 * Atomically decrements a 32-bit unsigned value. 165 189 * … … 168 192 static __inline__ void __atomic_decrement(__volatile__ unsigned *pu) 169 193 { 170 __asm__ __volatile__("lock decl %0"171 : "=m" (*pu) 194 __asm__ __volatile__("lock; decl %0" 195 : "=m" (*pu) 172 196 : "m" (*pu)); 197 } 198 199 /** 200 * Atomically decrements a 32-bit unsigned value. 201 * 202 * @param pu Pointer to the value to decrement. 203 */ 204 static __inline__ void __atomic_decrement_u32(__volatile__ uint32_t *pu32) 205 { 206 __asm__ __volatile__("lock; decl %0" 207 : "=m" (*pu32) 208 : "m" (*pu32)); 209 } 210 211 /** 212 * Atomically decrements a 16-bit unsigned value. 213 * 214 * @param pu16 Pointer to the value to decrement. 215 */ 216 static __inline__ void __atomic_decrement_u16(uint16_t __volatile__ *pu16) 217 { 218 __asm__ __volatile__("lock; decw %0" 219 : "=m" (*pu16) 220 : "m" (*pu16)); 173 221 } 174 222 … … 192 240 "2:\n\t" 193 241 "incl %0\n\t" 194 "lock 242 "lock; cmpxchgl %0, %1\n\t" 195 243 "jz 3f\n\t" 196 244 "jmp 1b\n" … … 228 276 "2:\n\t" 229 277 "incw %w0\n\t" 230 "lock 278 "lock; cmpxchgw %w0, %2\n\t" 231 279 "jz 3f\n\t" 232 280 "jmp 1b\n\t" … … 261 309 "2:\n\t" 262 310 "decl %0\n\t" 263 "lock 311 "lock; cmpxchgl %0, %1\n\t" 264 312 "jz 3f\n\t" 265 313 "jmp 1b\n" … … 297 345 "2:\n\t" 298 346 "decw %%bx\n\t" 299 "lock 347 "lock; cmpxchgw %w0, %1\n\t" 300 348 "jz 3f\n\t" 301 349 "jmp 1b\n" … … 321 369 static inline unsigned __atomic_cmpxchg32(volatile uint32_t *pu32, uint32_t u32New, uint32_t u32Old) 322 370 { 323 __asm__ __volatile__("lock 371 __asm__ __volatile__("lock; cmpxchgl %2, %1\n\t" 324 372 "setz %%al\n\t" 325 373 "movzx %%al, %%eax\n\t" -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/FastInfoBlocks.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1983 r1984 130 130 * System stuff 131 131 */ 132 /** Get the current millisecond counter value. */ 132 133 #define fibGetMsCount() (__libc_GpFIBGIS->SIS_MsCount) 134 /** Get the Unix timestamp (seconds). */ 135 #define fibGetUnixSeconds() (__libc_GpFIBGIS->SIS_BigTime) 133 136 134 137 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/backend.h
-
Property cvs2svn:cvs-rev
changed from
1.22
to1.23
r1983 r1984 34 34 #include <sys/time.h> 35 35 #include <sys/wait.h> 36 #include <sys/sem.h> 36 37 #include <signal.h> 37 38 #include <emx/io.h> … … 890 891 /** @} */ 891 892 893 894 /** @defgroup grp_Back_sysvipc LIBC Backend - SysV IPC 895 * @{ */ 896 /** 897 * semctl syscall 898 */ 899 int __libc_Back_sysvSemCtl(int semid, int semnum, int cmd, union semun real_arg); 900 901 /** 902 * sysget syscall. 903 */ 904 int __libc_Back_sysvSemGet(key_t key, int nsems, int semflg); 905 906 /** 907 * semop syscall. 908 */ 909 int __libc_Back_sysvSemOp(int semid, struct sembuf *sops_user, size_t nsops); 910 911 /** @} */ 912 892 913 __END_DECLS 893 914 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/sharedpm.h
-
Property cvs2svn:cvs-rev
changed from
1.21
to1.22
r1983 r1984 4 4 * LIBC Shared Process Management. 5 5 * 6 * 6 * Copyright (c) 2004-2005 knut st. osmundsen <bird@anduin.net> 7 * Copyright (c) 2004 nickk 7 8 * 8 9 * This file is part of InnoTek LIBC. … … 30 31 #include <sys/types.h> 31 32 #include <sys/signal.h> 33 #include <sys/ipc.h> 32 34 33 35 … … 553 555 unsigned long hevNotify; 554 556 555 /* 116 - The rest of the block, up to cbProcess, is undefined in this version. 557 /** 116 - Pointer to SysV Sempahore globals. */ 558 struct __libc_SysV_Sem *pSysVSem; 559 560 /* 120 - The rest of the block, up to cbProcess, is undefined in this version. 556 561 * Future versions of LIBC may use this area assuming it's initalized with zeros. 557 562 */ … … 729 734 730 735 /** 736 * Checks if the calling process is a member of the specified group. 737 * 738 * @returns 0 if member. 739 * @returns -EPERM if not member. 740 * @param gid The group id in question. 741 */ 742 int __libc_spmIsGroupMember(gid_t gid); 743 744 /** 745 * Check if the caller can access the SysV IPC object as requested. 746 * 747 * @returns 0 if we can. 748 * @returns -EPERM if we cannot. 749 * @param pPerm The IPC permission structure. 750 * @param Mode The access request. IPC_M, IPC_W or IPC_R. 751 */ 752 int __libc_spmCanIPC(struct ipc_perm *pPerm, mode_t Mode); 753 754 /** 731 755 * Marks the current process (if we have it around) as zombie 732 756 * or dead freeing all resources associated with it. … … 841 865 * 842 866 * @returns 0 on success. 843 * @returns -1 and errno on failure. 867 * @returns Negative error code (errno.h) on failure. 868 * 844 869 * @param pRegRec Pointer to the exception handler registration record. 870 * @param ppSPMHdr Where to store the pointer to the SPM header. Can be NULL. 871 * 845 872 * @remark Don't even think of calling this if you're not LIBC! 846 873 */ 847 int __libc_spmLock(__LIBC_PSPMXCPTREGREC pRegRec );874 int __libc_spmLock(__LIBC_PSPMXCPTREGREC pRegRec, __LIBC_PSPMHEADER *ppSPMHdr); 848 875 849 876 /** … … 851 878 * 852 879 * @returns 0 on success. 853 * @returns -1 on and errno failure. 880 * @returns Negative error code (errno.h) on failure. 881 * 854 882 * @param pRegRec Pointer to the exception handler registration record. 883 * 855 884 * @remark Don't even think of calling this if you're not LIBC! 856 885 */ … … 859 888 /** 860 889 * Allocate memory from the LIBC shared memory. 890 * 891 * The SPM must be locked using __libc_spmLock() prior to calling this function! 861 892 * 862 893 * @returns Pointer to allocated memory on success. 863 894 * @returns NULL on failure. 895 * 864 896 * @param cbSize Size of memory to allocate. 897 * 865 898 * @remark Don't think of calling this if you're not LIBC! 866 899 */ 867 void * __libc_spmAlloc(size_t cbSize); 868 869 /** 870 * Free memory allocated by __libc_SpmAlloc(). 900 void * __libc_spmAllocLocked(size_t cbSize); 901 902 /** 903 * Free memory allocated by __libc_spmAllocLocked() or __libc_spmAlloc(). 904 * 905 * The SPM must be locked using __libc_spmLock() prior to calling this function! 871 906 * 872 907 * @returns 0 on success. 873 908 * @returns -1 and errno on failure. 909 * 874 910 * @param pv Pointer to memory block returned by __libc_SpmAlloc(). 875 911 * NULL is allowed. 876 912 * @remark Don't think of calling this if you're not LIBC! 877 913 */ 914 int __libc_spmFreeLocked(void *pv); 915 916 /** 917 * Allocate memory from the LIBC shared memory. 918 * 919 * @returns Pointer to allocated memory on success. 920 * @returns NULL on failure. 921 * 922 * @param cbSize Size of memory to allocate. 923 * 924 * @remark Don't think of calling this if you're not LIBC! 925 */ 926 void * __libc_spmAlloc(size_t cbSize); 927 928 /** 929 * Free memory allocated by __libc_SpmAlloc(). 930 * 931 * @returns 0 on success. 932 * @returns -1 and errno on failure. 933 * 934 * @param pv Pointer to memory block returned by __libc_SpmAlloc(). 935 * NULL is allowed. 936 * 937 * @remark Don't think of calling this if you're not LIBC! 938 */ 878 939 int __libc_spmFree(void *pv); 879 940 880 881 /** 882 * Register TCPIP termination handler. 941 /** 942 * Register termination handler. 883 943 * 884 944 * This is a manual way of by passing a.out's broken weak symbols. 885 * @param pfnTerm Pointer to the termination function. 886 */ 887 void __libc_spmSocketRegTerm(void (*pfnTerm)(void)); 945 */ 946 void __libc_spmRegTerm(void (*pfnTerm)(void)); 888 947 889 948 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/thread.h
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1983 r1984 73 73 volatile int fDone; 74 74 } __LIBC_THREAD_SIGSUSPEND, *__LIBC_PTHREAD_SIGSUSPEND; 75 76 77 /** 78 * Signal notification callback function. 79 * 80 * This is a notification which can be used to correct the state of 81 * a system object before any user code is executed. 82 * 83 * The semaphore lock is hold and signals are all on hold, so be very careful with waitin 84 * on other semphores and stuff like that. Crashing is totally forbidden. :-) 85 * 86 * @param iSignalNo The signal number. 87 * @param pvUser The user argument. 88 */ 89 typedef void __LIBC_FNSIGCALLBACK(int iSignalNo, void *pvUser); 90 /** Pointer to a signal callback function. */ 91 typedef __LIBC_FNSIGCALLBACK *__LIBC_PFNSIGCALLBACK; 75 92 76 93 … … 174 191 * when ever a thread enters for processing a signal asynchronously. */ 175 192 volatile unsigned long ulSigLastTS; 176 193 /** Callback on signal/exception. */ 194 __LIBC_PFNSIGCALLBACK pfnSigCallback; 195 /** User argument to signal/exception callback. */ 196 void *pvSigCallbackUser; 177 197 178 198 /** Thread status, chiefly used for the u member of the thread structure. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/ipc.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1983 r1984 126 126 #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) 127 127 128 #ifdef __EMX__ 129 int __libc_back_ipcperm(struct ipc_perm *, int); 130 #else /* !__EMX__ */ 128 131 struct thread; 129 132 struct proc; … … 133 136 extern void (*shmfork_hook)(struct proc *, struct proc *); 134 137 extern void (*shmexit_hook)(struct vmspace *); 138 #endif /* !__EMX__ */ 135 139 136 140 #else /* ! _KERNEL */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/sem.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1983 r1984 10 10 /** @file 11 11 * FreeBSD 5.3 12 * @changed bird: no padding in semid_ds. seminfo and semexit are static in our 'kernel'. 12 13 */ 13 14 … … 24 25 unsigned short sem_nsems; /* number of sems in set */ 25 26 time_t sem_otime; /* last operation time */ 27 #ifndef __EMX__ /* space is precious */ 26 28 long sem_pad1; /* SVABI/386 says I need this here */ 29 #endif 27 30 time_t sem_ctime; /* last change time */ 28 31 /* Times measured in secs since */ 29 32 /* 00:00:00 GMT, Jan. 1, 1970 */ 33 #ifndef __EMX__ /* space is precious */ 30 34 long sem_pad2; /* SVABI/386 says I need this here */ 31 35 long sem_pad3[4]; /* SVABI/386 says I need this here */ 36 #endif 32 37 }; 33 38 … … 87 92 semaem; /* adjust on exit max value */ 88 93 }; 94 #ifndef __EMX__ 89 95 extern struct seminfo seminfo; 96 #endif 90 97 91 98 /* internal "mode" bits */ … … 93 100 #define SEM_DEST 02000 /* semaphore will be destroyed on last detach */ 94 101 102 #ifndef __EMX__ 95 103 /* 96 104 * Process sem_undo vectors at proc exit. 97 105 */ 98 106 void semexit(struct proc *p); 107 #endif /* !__EMX__ */ 99 108 #endif /* _KERNEL */ 100 109 … … 114 123 115 124 __BEGIN_DECLS 125 #ifndef __EMX__ 116 126 int semsys(int, ...); 127 #endif 117 128 int semctl(int, int, int, ...); 118 129 int semget(key_t, int, int); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.def
-
Property cvs2svn:cvs-rev
changed from
1.110
to1.111
r1983 r1984 1526 1526 "___nullstub_function" @1531 1527 1527 "___nullstub_data" @1532 1528 "__getenv_int" @1533 1529 "__getenv_long" @1534 1530 "__getenv_longlong" @1535 1531 "___libc_Back_sysvSemCtl" @1536 1532 "___libc_Back_sysvSemGet" @1537 1533 "___libc_Back_sysvSemOp" @1538 1534 "__std_ftok" @1539 1535 "__std_semctl" @1540 1536 "__std_semget" @1541 1537 "__std_semop" @1542 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sharedpm.c
-
Property cvs2svn:cvs-rev
changed from
1.29
to1.30
r1983 r1984 67 67 #include <stdio.h> 68 68 #include <sys/types.h> 69 #include <sys/ipc.h> 69 70 #include <emx/startup.h> 70 71 #include <386/builtin.h> … … 103 104 /** Checking for nested access to the shared memory. */ 104 105 static unsigned gcNesting; 105 /** Pointer to t cpip termination handler. */106 static void (*gapfn SocketTerm[2])(void);106 /** Pointer to termination handlers. */ 107 static void (*gapfnExitList[4])(void); 107 108 108 109 … … 925 926 926 927 /** 928 * Checks if the calling process is a member of the specified group. 929 * 930 * @returns 0 if member. 931 * @returns -EPERM if not member. 932 * @param gid The group id in question. 933 */ 934 int __libc_spmIsGroupMember(gid_t gid) 935 { 936 if (gpSPMSelf->egid == gid) 937 return 0; 938 int c = sizeof(gpSPMSelf->agidGroups) / sizeof(gpSPMSelf->agidGroups[0]); 939 gid_t *pGid = &gpSPMSelf->agidGroups[0]; 940 while (c-- > 0) 941 if (*pGid++ == gid) 942 return 0; 943 return -EPERM; 944 } 945 946 947 /** 948 * Check if the caller can access the SysV IPC object as requested. 949 * 950 * @returns 0 if we can. 951 * @returns -EPERM if we cannot. 952 * @param pPerm The IPC permission structure. 953 * @param Mode The access request. IPC_M, IPC_W or IPC_R. 954 */ 955 int __libc_spmCanIPC(struct ipc_perm *pPerm, mode_t Mode) 956 { 957 uid_t euid = gpSPMSelf->euid; 958 if ( euid != pPerm->cuid 959 && euid != pPerm->uid) 960 { 961 /* 962 * For a non-create/owner, we require privilege to 963 * modify the object protections. Note: some other 964 * implementations permit IPC_M to be delegated to 965 * unprivileged non-creator/owner uids/gids. 966 */ 967 if (Mode & IPC_M) 968 return __libc_spmIsSuperUser(); 969 970 /* 971 * Try to match against creator/owner group; if not, fall 972 * back on other. 973 */ 974 Mode >>= 3; 975 if ( __libc_spmIsGroupMember(pPerm->gid) != 0 976 && __libc_spmIsGroupMember(pPerm->cgid) != 0) 977 Mode >>= 3; 978 } 979 else 980 { 981 /* 982 * Always permit the creator/owner to update the object 983 * protections regardless of whether the object mode 984 * permits it. 985 */ 986 if (Mode & IPC_M) 987 return 0; 988 } 989 990 if ((Mode & pPerm->mode) != Mode) 991 return __libc_spmIsSuperUser(); 992 return 0; 993 } 994 995 996 /** 927 997 * Gets the specified Id. 928 998 * … … 1159 1229 * 1160 1230 * @returns 0 on success. 1161 * @returns -1 and errno on failure. 1231 * @returns Negative error code (errno.h) on failure. 1232 * 1162 1233 * @param pRegRec Pointer to the exception handler registration record. 1234 * @param ppSPMHdr Where to store the pointer to the SPM header. Can be NULL. 1235 * 1163 1236 * @remark Don't even think of calling this if you're not LIBC! 1164 1237 */ 1165 int __libc_spmLock(__LIBC_PSPMXCPTREGREC pRegRec) 1166 { 1167 LIBCLOG_ENTER("\n"); 1168 int rc = spmRequestMutexErrno(pRegRec); 1169 if (!rc) 1170 LIBCLOG_RETURN_INT(0); 1171 errno = rc; 1172 LIBCLOG_RETURN_INT(-1); 1238 int __libc_spmLock(__LIBC_PSPMXCPTREGREC pRegRec, __LIBC_PSPMHEADER *ppSPMHdr) 1239 { 1240 LIBCLOG_ENTER("pRegRec=%p ppSPMHdr=%p\n", (void *)pRegRec, (void *)ppSPMHdr); 1241 int rc = spmRequestMutex(pRegRec); 1242 if (!rc && ppSPMHdr) 1243 *ppSPMHdr = gpSPMHdr; 1244 LIBCLOG_RETURN_INT(rc); 1173 1245 } 1174 1246 … … 1178 1250 * 1179 1251 * @returns 0 on success. 1180 * @returns -1 on and errno failure. 1252 * @returns Negative error code (errno.h) on failure. 1253 * 1181 1254 * @param pRegRec Pointer to the exception handler registration record. 1255 * 1182 1256 * @remark Don't even think of calling this if you're not LIBC! 1183 1257 */ 1184 1258 int __libc_spmUnlock(__LIBC_PSPMXCPTREGREC pRegRec) 1185 1259 { 1186 LIBCLOG_ENTER(" \n");1260 LIBCLOG_ENTER("pRegRec=%p\n", (void *)pRegRec); 1187 1261 int rc = spmReleaseMutex(pRegRec); 1188 if (!rc) 1189 LIBCLOG_RETURN_INT(0); 1190 errno = -rc; 1191 LIBCLOG_RETURN_INT(-1); 1262 LIBCLOG_RETURN_INT(rc); 1192 1263 } 1193 1264 … … 1195 1266 /** 1196 1267 * Allocate memory from the LIBC shared memory. 1268 * 1269 * The SPM must be locked using __libc_spmLock() prior to calling this function! 1197 1270 * 1198 1271 * @returns Pointer to allocated memory on success. 1199 1272 * @returns NULL on failure. 1273 * 1200 1274 * @param cbSize Size of memory to allocate. 1275 * 1276 * @remark Don't think of calling this if you're not LIBC! 1277 */ 1278 void * __libc_spmAllocLocked(size_t cbSize) 1279 { 1280 LIBCLOG_ENTER("cbSize=%d\n", cbSize); 1281 void *pvRet = spmAlloc(cbSize); 1282 LIBCLOG_RETURN_P(pvRet); 1283 } 1284 1285 1286 /** 1287 * Free memory allocated by __libc_spmAllocLocked() or __libc_spmAlloc(). 1288 * 1289 * The SPM must be locked using __libc_spmLock() prior to calling this function! 1290 * 1291 * @returns 0 on success. 1292 * @returns -1 and errno on failure. 1293 * 1294 * @param pv Pointer to memory block returned by __libc_SpmAlloc(). 1295 * NULL is allowed. 1296 * @remark Don't think of calling this if you're not LIBC! 1297 */ 1298 int __libc_spmFreeLocked(void *pv) 1299 { 1300 LIBCLOG_ENTER("pv=%p\n", pv); 1301 int rc = spmFree(pv); 1302 LIBCLOG_RETURN_INT(rc); 1303 } 1304 1305 1306 /** 1307 * Allocate memory from the LIBC shared memory. 1308 * 1309 * @returns Pointer to allocated memory on success. 1310 * @returns NULL on failure. 1311 * 1312 * @param cbSize Size of memory to allocate. 1313 * 1201 1314 * @remark Don't think of calling this if you're not LIBC! 1202 1315 */ … … 1234 1347 1235 1348 /** 1236 * Free memory allocated by __libc_ SpmAlloc().1349 * Free memory allocated by __libc_spmAlloc(). 1237 1350 * 1238 1351 * @returns 0 on success. … … 1280 1393 1281 1394 /** 1282 * Register TCPIPtermination handler.1395 * Register termination handler. 1283 1396 * 1284 1397 * This is a manual way of by passing a.out's broken weak symbols. 1285 1398 */ 1286 void __libc_spm SocketRegTerm(void (*pfnTerm)(void))1399 void __libc_spmRegTerm(void (*pfnTerm)(void)) 1287 1400 { 1288 1401 LIBCLOG_ENTER("pfnTerm=%p\n", (void *)pfnTerm); 1289 if ( pfnTerm == gapfnSocketTerm[0] 1290 || pfnTerm == gapfnSocketTerm[1]) 1402 if ( pfnTerm == gapfnExitList[0] 1403 || pfnTerm == gapfnExitList[1] 1404 || pfnTerm == gapfnExitList[2] 1405 || pfnTerm == gapfnExitList[3]) 1291 1406 LIBCLOG_RETURN_VOID(); 1292 1407 1293 if (!gapfnSocketTerm[0]) 1294 gapfnSocketTerm[0] = pfnTerm; 1295 else if (!gapfnSocketTerm[1]) 1296 gapfnSocketTerm[1] = pfnTerm; 1408 if (!gapfnExitList[0]) 1409 gapfnExitList[0] = pfnTerm; 1410 else if (!gapfnExitList[1]) 1411 gapfnExitList[1] = pfnTerm; 1412 else if (!gapfnExitList[2]) 1413 gapfnExitList[2] = pfnTerm; 1414 else if (!gapfnExitList[3]) 1415 gapfnExitList[3] = pfnTerm; 1297 1416 else 1298 LIBC_ASSERTM_FAILED("There can only be two TCP/IP terminationroutines!!!!\n");1417 LIBC_ASSERTM_FAILED("There can only be 4 exit list routines!!!!\n"); 1299 1418 1300 1419 LIBCLOG_RETURN_VOID(); … … 1932 2051 /** 1933 2052 * This function checks that there is at least 2k of writable 1934 * stack available. If there isn't a crash is usually the2053 * stack available. If there isn't, a crash is usually the 1935 2054 * result. 1936 2055 * @internal … … 2290 2409 { 2291 2410 /* 2292 * Terminate tcpip.2411 * Exist list callbacks . 2293 2412 */ 2294 if (gapfnSocketTerm[0]) 2295 gapfnSocketTerm[0](); 2296 if (gapfnSocketTerm[1]) 2297 gapfnSocketTerm[1](); 2413 if (gapfnExitList[0]) 2414 gapfnExitList[0](); 2415 if (gapfnExitList[1]) 2416 gapfnExitList[1](); 2417 if (gapfnExitList[2]) 2418 gapfnExitList[2](); 2419 if (gapfnExitList[3]) 2420 gapfnExitList[3](); 2298 2421 2299 2422 /* -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/signals.c
-
Property cvs2svn:cvs-rev
changed from
1.26
to1.27
r1983 r1984 1027 1027 1028 1028 /* 1029 * Does this thread have a notification callback? 1030 */ 1031 if (pThrd->pfnSigCallback) 1032 pThrd->pfnSigCallback(iSignalNo, pThrd->pvSigCallbackUser); 1033 1034 /* 1029 1035 * Schedule the signal. 1030 1036 */ … … 2624 2630 2625 2631 /* 2632 * Does this thread have a notification callback? 2633 */ 2634 if (pThrd->pfnSigCallback) 2635 pThrd->pfnSigCallback(0, pThrd->pvSigCallbackUser); 2636 2637 /* 2626 2638 * Try schedule signals pending on 1st (SPM) and 2nd level (private). 2627 2639 */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/tcpipver.c
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1983 r1984 1339 1339 static void *pfn = (void*)tcpipInit; /* reference hack */ 1340 1340 pfn = pfn; 1341 __libc_spm SocketRegTerm(TCPNAME(Cleanup));1341 __libc_spmRegTerm(TCPNAME(Cleanup)); 1342 1342 LIBCLOG_RETURN_VOID(); 1343 1343 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.