|
|
1.1 root 1: /*
2: * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
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.
11: *
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
14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
19: *
20: * @APPLE_LICENSE_HEADER_END@
21: */
22: /*
23: * @OSF_COPYRIGHT@
24: */
25:
26: #ifndef _PPC_MACHINE_ROUTINES_H_
27: #define _PPC_MACHINE_ROUTINES_H_
28:
29: #include <mach/mach_types.h>
30: #include <mach/boolean.h>
31: #include <kern/kern_types.h>
32: #include <pexpert/pexpert.h>
33:
34:
35: #if defined(PEXPERT_KERNEL_PRIVATE) || defined(MACH_KERNEL_PRIVATE)
36: /* IO memory map services */
37:
38: /* Map memory map IO space */
39: vm_offset_t ml_io_map(
40: vm_offset_t phys_addr,
41: vm_size_t size);
42:
43: /* boot memory allocation */
44: vm_offset_t ml_static_malloc(
45: vm_size_t size);
46: #endif
47:
48: vm_offset_t
49: ml_static_ptovirt(
50: vm_offset_t);
51:
52: void ml_static_mfree(
53: vm_offset_t,
54: vm_size_t);
55:
56: /* virtual to physical on wired pages */
57: vm_offset_t ml_vtophys(
58: vm_offset_t vaddr);
59:
60: /* Init Interrupts */
61: void ml_install_interrupt_handler(
62: void *nub,
63: int source,
64: void *target,
65: IOInterruptHandler handler,
66: void *refCon);
67:
68: #ifdef MACH_KERNEL_PRIVATE
69: boolean_t fake_get_interrupts_enabled(void);
70: boolean_t fake_set_interrupts_enabled(boolean_t enable);
71: #endif
72:
73: /* Get Interrupts Enabled */
74: boolean_t ml_get_interrupts_enabled(void);
75:
76: /* Set Interrupts Enabled */
77: boolean_t ml_set_interrupts_enabled(boolean_t enable);
78:
79: /* Check if running at interrupt context */
80: boolean_t ml_at_interrupt_context(void);
81:
82: /* Generate a fake interrupt */
83: void ml_cause_interrupt(void);
84:
85: #ifdef MACH_KERNEL_PRIVATE
86: /* check pending timers */
87: void machine_clock_assist(void);
88: #endif
89:
90: /* PCI config cycle probing */
91: boolean_t ml_probe_read(
92: vm_offset_t paddr,
93: unsigned int *val);
94:
95: /* Read physical address */
96: unsigned int ml_phys_read(
97: vm_offset_t paddr);
98:
99: /* Write physical address */
100: void ml_phys_write(
101: vm_offset_t paddr, unsigned int data);
102:
103: /* Type for the IPI Hander */
104: typedef void (*ipi_handler_t)(void);
105:
106: /* Register a processor */
107: kern_return_t ml_processor_register(
108: cpu_id_t cpu_id,
109: vm_offset_t start_paddr,
110: processor_t *processor,
111: ipi_handler_t *ipi_handler,
112: boolean_t boot_cpu);
113:
114: #endif /* _PPC_MACHINE_ROUTINES_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.