home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / internal / 1710 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.1 KB

  1. From: aakash@hpcupt3.cup.hp.com (Aakash Sahai)
  2. Date: Thu, 20 Aug 1992 00:53:08 GMT
  3. Subject: Re: Clearing memory in SVr3 device drivers
  4. Message-ID: <46520022@hpcupt3.cup.hp.com>
  5. Organization: Hewlett Packard, Cupertino
  6. Path: sparky!uunet!usc!sdd.hp.com!hpscdc!hplextra!hpcc05!hpcuhb!hpcupt3!aakash
  7. Newsgroups: comp.unix.internals
  8. References: <1992Aug18.034538.414@candle.uucp>
  9. Lines: 18
  10.  
  11. > How do you clear out memory that is aligned in pages in a device driver
  12. > under SVr3.1?  Either physical or virtual address clearing will do.
  13. > -- 
  14. > Bruce Momjian
  15. > ----------
  16.  
  17. An efficient way to do this is to use bzero() kernel routine. It uses the
  18. best possible method suited for a given architecure to clear out memory and
  19. is normally written in assembly language to take advantage of special
  20. instructions ( if any ) to perform the task efficiently. Moreover, most of
  21. the implementations of bzero try to do as many aligned writes to memory as
  22. possible as misaligned writes are costlier. Some of the implementations even
  23. optimize the code to reduce the loop-overheads. In a nut-shell it is the best
  24. way to clear memory given any arbitrary virtual address.
  25.  
  26. -- Aakash
  27.  
  28. S.D.A.
  29.