diff options
Diffstat (limited to 'gcc/ada/5vosinte.adb')
-rw-r--r-- | gcc/ada/5vosinte.adb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ada/5vosinte.adb b/gcc/ada/5vosinte.adb index eddbdd1a87d..5c0909ee39e 100644 --- a/gcc/ada/5vosinte.adb +++ b/gcc/ada/5vosinte.adb @@ -6,8 +6,7 @@ -- -- -- B o d y -- -- -- --- -- --- Copyright (C) 1991-2000 Florida State University -- +-- Copyright (C) 1991-2002 Florida State University -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -43,11 +42,34 @@ pragma Polling (Off); -- tasking operations. It causes infinite loops and other problems. with Interfaces.C; use Interfaces.C; +with System.Machine_Code; use System.Machine_Code; + package body System.OS_Interface is + ------------------ + -- pthread_self -- + ------------------ + + function pthread_self return pthread_t is + use ASCII; + Self : pthread_t; + + begin + Asm ("call_pal 0x9e" & LF & HT & + "bis $31, $0, %0", + Outputs => pthread_t'Asm_Output ("=r", Self), + Clobber => "$0"); + return Self; + end pthread_self; + + ----------------- + -- sched_yield -- + ----------------- + function sched_yield return int is procedure sched_yield_base; pragma Import (C, sched_yield_base, "PTHREAD_YIELD_NP"); + begin sched_yield_base; return 0; |