]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/ecc.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / kern / ecc.h
1 #if !defined(_KERN_ECC_H)
2 #define _KERN_ECC_H
3
4 #include <sys/cdefs.h>
5
6 __BEGIN_DECLS
7
8 /*
9 * Copyright (c) 2013 Apple Inc. All rights reserved.
10 *
11 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
12 *
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.
21 *
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
27 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
28 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
34 */
35
36 #define ECC_EVENT_INFO_DATA_ENTRIES 8
37 struct 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 };
42
43
44 #ifdef KERNEL_PRIVATE
45 extern kern_return_t ecc_log_record_event(const struct ecc_event *ev);
46 #endif
47
48 #ifdef XNU_KERNEL_PRIVATE
49 extern kern_return_t ecc_log_get_next_event(struct ecc_event *ev);
50 extern uint32_t ecc_log_get_correction_count(void);
51 #endif
52
53 __END_DECLS
54
55 #endif /* !defined(_KERN_ECC_H) */