]> git.saurik.com Git - apple/xnu.git/blame - bsd/dev/random/YarrowCoreLib/src/yarrowUtils.c
xnu-792.6.76.tar.gz
[apple/xnu.git] / bsd / dev / random / YarrowCoreLib / src / yarrowUtils.c
CommitLineData
1c79356b 1/*
0b4e3aa0 2 * Copyright (c) 1999, 2000-2001 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
37839358
A
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
1c79356b 11 *
37839358
A
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
37839358
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
1c79356b 22
0b4e3aa0
A
23/*
24 File: yarrowUtils.c
1c79356b 25
0b4e3aa0 26 Contains: Misc. utility functions.
1c79356b 27
0b4e3aa0 28 Written by: Doug Mitchell
1c79356b 29
0b4e3aa0 30 Copyright: (c) 2000 by Apple Computer, Inc., all rights reserved.
1c79356b 31
0b4e3aa0 32 Change History (most recent first):
1c79356b 33
0b4e3aa0
A
34 02/29/00 dpm Created.
35
36*/
1c79356b 37
0b4e3aa0 38#include "dev/random/YarrowCoreLib/include/yarrowUtils.h"
91447636 39#include <string.h>
1c79356b 40
0b4e3aa0
A
41void
42trashMemory(void* mem, int len)
43/* This function should only be used on data in RAM */
44{
45 if(len == 0) {
46 /* some memsets really don't like this */
47 return;
48 }
49
50 /* Cycle a bit just in case it is one of those weird memory units */
51 /* No, I don't know which units those would be */
52 memset(mem,0x00,len);
53 memset(mem,0xFF,len);
54 memset(mem,0x00,len);
1c79356b 55}
0b4e3aa0 56
1c79356b 57