_vfork.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ;
  2. ; Port of uClibc for TMS320C6000 DSP architecture
  3. ; Copyright (C) 2004 Texas Instruments Incorporated
  4. ; Author of TMS320C6000 port: Aurelien Jacquiot
  5. ;
  6. ; This program is free software; you can redistribute it and/or modify it
  7. ; under the terms of the GNU Library General Public License as published by
  8. ; the Free Software Foundation; either version 2 of the License, or (at your
  9. ; option) any later version.
  10. ;
  11. ; This program is distributed in the hope that it will be useful, but WITHOUT
  12. ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
  14. ; for more details.
  15. ;
  16. ; You should have received a copy of the GNU Library General Public License
  17. ; along with this program; if not, write to the Free Software Foundation,
  18. ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. ;
  20. ; .import __errno_location
  21. .global __vfork
  22. __vfork:
  23. MVK .S2 190,B0 ; __NR_vfork
  24. #ifndef _TMS320C6400_PLUS
  25. MVC .S2 CSR,B2
  26. CLR .S2 B2,0,0,B1
  27. MVC .S2 B1,CSR
  28. MVC .S2 IFR,B1
  29. SET .S2 B1,6,6,B1
  30. MVC .S2 B1,ISR
  31. MVC .S2 B2,CSR
  32. NOP
  33. #else
  34. SWE
  35. #endif
  36. MVK .S2 -4096,B4
  37. CMPGTU .L2X B4,A4,B2 ; check error
  38. [B2] BNOP .S2 B3,5
  39. NEG .S1 A4,A4
  40. STW .D2T1 A4,*B15--[2]
  41. STW .D2T2 B3,*+B15[1]
  42. CALLP .S2 __errno_location,B3
  43. LDW .D2T2 *+B15[1],B3
  44. LDW .D2T1 *++B15[2],A5
  45. NOP 3
  46. BNOP .S2 B3,3
  47. STW .D1T1 A5,*A4
  48. MVK .L1 -1,A4
  49. weak_alias(__vfork,vfork)
  50. libc_hidden_weak(vfork)