home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
- From: <mahan@TGV.COM>
- Newsgroups: vmsnet.internals
- Subject: Re: Another newbie C internals question
- Message-ID: <921216120221.26400434@TGV.COM>
- Date: Wed, 16 Dec 92 12:02:21 PST
- Organization: Macro32<==>Vmsnet.Internals Gateway
- X-Gateway-Source-Info: Mailing List
- Lines: 28
-
- In article <1992Dec15.161738.1258@mwk.uucp> you write:
- #
- # OK, I'm still converting thousands of lines of MACRO-32 to DEC C on
- #an Alpha. I am now wondering about "library functions" such as memcpy,
- #strncpy and the like.
- #
- # Is there any reason to think they would be safe to call in kernel
- #mode, at high IPL, and with spinlocks held? Or would that be more like
- #expecting lib$get_input to work in the middle of a driver?
- #
-
- It is absolutely not safe to call any of the C RTL routines from kernel mode.
- Some might work, others like sprintf, horrible mangale the stack. This is
- not good as on the Alpha there is nothing to clean up after you and get the
- stack back in the proper order. You should determine what it is you really
- need and possible 1) Write the code yourself or 2) make use of the OTS$ routines
- to do this for you. Also, you what to take advantage of the linkage
- pragma to enforce "light-weight" call frames.
-
- --
- Patrick L. Mahan
-
- --- TGV Window Washer ------------------------------- Mahan@TGV.COM ---------
-
- Waking a person unnecessarily should not be considered - Lazarus Long
- a capital crime. For a first offense, that is From the Notebooks of
- Lazarus Long
-
-