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