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