2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 * Carnegie Mellon requests users of this software to return to
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
27 * $Id: bzero.c,v 1.1 1993/09/17 18:43:47 phil Exp $
31 * bzero EXPORTED function
33 * Clear memory locations
35 * Optimize for aligned memory ops, if possible and simple.
36 * Might need later recoding in assembly for better efficiency.
40 register unsigned addr
;
41 register unsigned bcount
;
45 if (bcount
== 0) /* sanity */
49 *((char *) addr
++) = 0;
53 *((char *) addr
++) = 0;
57 *((char *) addr
++) = 0;
64 for (i
= bcount
>> 2; i
; i
--, addr
+= 4)
68 case 3: *((char*)addr
++) = 0;
69 case 2: *((char*)addr
++) = 0;
70 case 1: *((char*)addr
++) = 0;