home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / network / netlib_1 / NetLibSrc / hdr / Vars < prev   
Text File  |  1995-10-05  |  871b  |  58 lines

  1. ;
  2. ; This is the code for storing a1 in errno - the SharedCLibrary's
  3. ; variable.  If $module is defined, then the appropriate relocation
  4. ; is performed too
  5. ;
  6.  
  7.     IMPORT    |__errno|
  8.  
  9.     MACRO
  10.     StoreErrno    $Temp1, $Temp2
  11.  
  12.     ASSERT    $Temp1 <> a1
  13.     ASSERT    $Temp2 <> a2
  14.     ASSERT    $Temp1 <> $Temp2
  15.  
  16.     LDR    $Temp1, =|__errno|    ; find address of errno
  17.     [    "$ModuleCode" = "yes"
  18.     LDR    $Temp2, [sl, #-536]    ; if we are a module, find offset
  19.     ADD    $Temp1, $Temp1, $Temp2  ; and add it in.
  20.     ]
  21.     STR    a1, [$Temp1, #0]    ; store error in __errno
  22.     MEND
  23.  
  24.     MACRO
  25.     EnterSVC
  26.  
  27.     [    "$ModuleCode" <> "yes"
  28.     STMFD    sp!, {sl,lr}
  29.     MOV    sl, #3
  30.     AND    sl, sl, pc
  31.     SWI    XOS_EnterOS
  32.     MOV    a1, a1
  33.     STMFD    sp!, {sl}
  34.     ]
  35.     MEND
  36.  
  37.     MACRO
  38.     ExitSVC
  39.  
  40.     [    "$ModuleCode" <> "yes"
  41.     LDMFD    sp!, {sl}
  42.     ORRVS    sl, sl, #1<<28
  43.     TEQP    pc, sl
  44.     MOV    a1, a1
  45.     LDMFD    sp!, {sl,lr}
  46.     ]
  47.     MEND
  48.  
  49.     MACRO
  50.     CallSWI    $swiname
  51.  
  52.     EnterSVC
  53.     SWI    $swiname
  54.     ExitSVC
  55.     MEND
  56.  
  57.     END
  58.