Get the MI portions of VKERNEL to build, start linking it against libc.
[dragonfly.git] / sys / platform / vkernel / include / smp.h
CommitLineData
4e497a4d
MD
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * $FreeBSD: src/sys/i386/include/smp.h,v 1.50.2.5 2001/02/13 22:32:45 tegge Exp $
10 * $DragonFly: src/sys/platform/vkernel/include/smp.h,v 1.1 2006/11/08 16:40:00 dillon Exp $
11 *
12 */
13
14#ifndef _MACHINE_SMP_H_
15#define _MACHINE_SMP_H_
16
17#ifdef _KERNEL
18
19#if defined(SMP)
20
21#ifndef LOCORE
22
23#if 0
24
25/*
26 * For sending values to POST displays.
27 * XXX FIXME: where does this really belong, isa.h/isa.c perhaps?
28 */
29extern int current_postcode; /** XXX currently in mp_machdep.c */
30#define POSTCODE(X) current_postcode = (X), \
31 outb(0x80, current_postcode)
32#define POSTCODE_LO(X) current_postcode &= 0xf0, \
33 current_postcode |= ((X) & 0x0f), \
34 outb(0x80, current_postcode)
35#define POSTCODE_HI(X) current_postcode &= 0x0f, \
36 current_postcode |= (((X) << 4) & 0xf0), \
37 outb(0x80, current_postcode)
38
39
40#include <machine_base/apic/apicreg.h>
41#include <machine/pcb.h>
42
43/* global data in mpboot.s */
44extern int bootMP_size;
45
46/* functions in mpboot.s */
47void bootMP (void);
48
49#endif
50
51#if 0
52/* global data in apic_vector.s */
53extern volatile u_int stopped_cpus;
54extern volatile u_int started_cpus;
55
56extern volatile u_int checkstate_probed_cpus;
57extern void (*cpustop_restartfunc) (void);
58
59/* functions in apic_ipl.s */
60void apic_eoi (void);
61u_int io_apic_read (int, int);
62void io_apic_write (int, int, u_int);
63
64#endif
65
66#if 0
67/* global data in mp_machdep.c */
68extern int bsp_apic_ready;
69extern int mp_naps;
70extern int mp_nbusses;
71extern int mp_napics;
72extern int boot_cpu_id;
73extern vm_offset_t cpu_apic_address;
74extern vm_offset_t io_apic_address[];
75extern u_int32_t cpu_apic_versions[];
76extern u_int32_t *io_apic_versions;
77extern int cpu_num_to_apic_id[];
78extern int io_num_to_apic_id[];
79extern int apic_id_to_logical[];
80#endif
81
82#if 0
83#define APIC_INTMAPSIZE 24
84struct apic_intmapinfo {
85 int ioapic;
86 int int_pin;
87 volatile void *apic_address;
88 int redirindex;
89};
90extern struct apic_intmapinfo int_to_apicintpin[];
91extern struct pcb stoppcbs[];
92
93#endif
94
95#if 0
96/* functions in mp_machdep.c */
97void *permanent_io_mapping(vm_paddr_t);
98u_int mp_bootaddress (u_int);
99int mp_probe (void);
100void mp_start (void);
101void mp_announce (void);
102u_int isa_apic_mask (u_int);
103int isa_apic_irq (int);
104int pci_apic_irq (int, int, int);
105int apic_irq (int, int);
106int next_apic_irq (int);
107int undirect_isa_irq (int);
108int undirect_pci_irq (int);
109int apic_bus_type (int);
110int apic_src_bus_id (int, int);
111int apic_src_bus_irq (int, int);
112int apic_int_type (int, int);
113int apic_trigger (int, int);
114int apic_polarity (int, int);
115void assign_apic_irq (int apic, int intpin, int irq);
116void revoke_apic_irq (int irq);
117void init_secondary (void);
118int stop_cpus (u_int);
119void ap_init (void);
120int restart_cpus (u_int);
121void forward_signal (struct proc *);
122
123#endif
124
125#if 0
126/* global data in mpapic.c */
127extern volatile lapic_t lapic;
128extern volatile ioapic_t **ioapic;
129#endif
130
131/* functions in mpapic.c */
132#if 0
133void apic_dump (char*);
134void apic_initialize (void);
135void imen_dump (void);
136int apic_ipi (int, int, int);
137void selected_apic_ipi (u_int, int, int);
138void single_apic_ipi(int cpu, int vector, int delivery_mode);
139int single_apic_ipi_passive(int cpu, int vector, int delivery_mode);
140int io_apic_setup (int);
141void io_apic_setup_intpin (int, int);
142void io_apic_set_id (int, int);
143int io_apic_get_id (int);
144int ext_int_setup (int, int);
145#endif
146
147#if 0
148void clr_io_apic_mask24 (int, u_int32_t);
149void set_io_apic_mask24 (int, u_int32_t);
150#endif
151
152#if 0
153void set_apic_timer (int);
154int read_apic_timer (void);
155void u_sleep (int);
156#endif
157void cpu_send_ipiq (int);
158int cpu_send_ipiq_passive (int);
159
160/* global data in init_smp.c */
161extern cpumask_t smp_active_mask;
162
163#endif /* !LOCORE */
164#else /* !SMP */
165
166#define smp_active_mask 1 /* smp_active_mask always 1 on UP machines */
167
168#endif
169
170#endif /* _KERNEL */
171#endif /* _MACHINE_SMP_H_ */