]> git.saurik.com Git - apple/xnu.git/blame - osfmk/kern/ecc.h
xnu-3789.51.2.tar.gz
[apple/xnu.git] / osfmk / kern / ecc.h
CommitLineData
fe8ab488
A
1#if !defined(_KERN_ECC_H)
2#define _KERN_ECC_H
3
4#include <sys/cdefs.h>
5
6__BEGIN_DECLS
7
1c79356b 8/*
fe8ab488 9 * Copyright (c) 2013 Apple Inc. All rights reserved.
5d5c5d0d 10 *
2d21ac55 11 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 12 *
2d21ac55
A
13 * This file contains Original Code and/or Modifications of Original Code
14 * as defined in and that are subject to the Apple Public Source License
15 * Version 2.0 (the 'License'). You may not use this file except in
16 * compliance with the License. The rights granted to you under the License
17 * may not be used to create, or enable the creation or redistribution of,
18 * unlawful or unlicensed copies of an Apple operating system, or to
19 * circumvent, violate, or enable the circumvention or violation of, any
20 * terms of an Apple operating system software license agreement.
8f6c56a5 21 *
2d21ac55
A
22 * Please obtain a copy of the License at
23 * http://www.opensource.apple.com/apsl/ and read it before using this file.
24 *
25 * The Original Code and all software distributed under the License are
26 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
27 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
28 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
29 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
30 * Please see the License for the specific language governing rights and
31 * limitations under the License.
8f6c56a5 32 *
2d21ac55 33 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
34 */
35
fe8ab488
A
36#define ECC_EVENT_INFO_DATA_ENTRIES 8
37struct ecc_event {
38 uint8_t id; // ID of memory (e.g. L2C), platform-specific
39 uint8_t count; // Of uint64_t's used, starting at index 0
40 uint64_t data[ECC_EVENT_INFO_DATA_ENTRIES] __attribute__((aligned(8))); // Event-specific data
41};
1c79356b
A
42
43
fe8ab488
A
44#ifdef KERNEL_PRIVATE
45extern kern_return_t ecc_log_record_event(const struct ecc_event *ev);
fe8ab488 46#endif
0b4e3aa0 47
fe8ab488
A
48#ifdef XNU_KERNEL_PRIVATE
49extern void ecc_log_init(void);
50extern kern_return_t ecc_log_get_next_event(struct ecc_event *ev);
51extern uint32_t ecc_log_get_correction_count(void);
52#endif
1c79356b 53
fe8ab488 54__END_DECLS
1c79356b 55
fe8ab488 56#endif /* !defined(_KERN_ECC_H) */