]>
Commit | Line | Data |
---|---|---|
1c79356b A |
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 | * Mach Operating System | |
27 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | |
28 | * All Rights Reserved. | |
29 | * | |
30 | * Permission to use, copy, modify and distribute this software and its | |
31 | * documentation is hereby granted, provided that both the copyright | |
32 | * notice and this permission notice appear in all copies of the | |
33 | * software, derivative works or modified versions, and any portions | |
34 | * thereof, and that both notices appear in supporting documentation. | |
35 | * | |
36 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
37 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
38 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
39 | * | |
40 | * Carnegie Mellon requests users of this software to return to | |
41 | * | |
42 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
43 | * School of Computer Science | |
44 | * Carnegie Mellon University | |
45 | * Pittsburgh PA 15213-3890 | |
46 | * | |
47 | * any improvements or extensions that they make and grant Carnegie Mellon | |
48 | * the rights to redistribute these changes. | |
49 | */ | |
50 | /* | |
51 | */ | |
52 | ||
53 | /* | |
54 | Copyright 1988, 1989 by Intel Corporation, Santa Clara, California. | |
55 | ||
56 | All Rights Reserved | |
57 | ||
58 | Permission to use, copy, modify, and distribute this software and | |
59 | its documentation for any purpose and without fee is hereby | |
60 | granted, provided that the above copyright notice appears in all | |
61 | copies and that both the copyright notice and this permission notice | |
62 | appear in supporting documentation, and that the name of Intel | |
63 | not be used in advertising or publicity pertaining to distribution | |
64 | of the software without specific, written prior permission. | |
65 | ||
66 | INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE | |
67 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, | |
68 | IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR | |
69 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | |
70 | LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, | |
71 | NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | |
72 | WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
73 | */ | |
74 | ||
75 | #include <platforms.h> | |
76 | /* Definitions for 8254 Programmable Interrupt Timer ports on AT 386 */ | |
77 | #define PITCTR0_PORT 0x40 /* counter 0 port */ | |
78 | #define PITCTR1_PORT 0x41 /* counter 1 port */ | |
79 | #define PITCTR2_PORT 0x42 /* counter 2 port */ | |
80 | #define PITCTL_PORT 0x43 /* PIT control port */ | |
81 | #define PITAUX_PORT 0x61 /* PIT auxiliary port */ | |
82 | /* bits used in auxiliary control port for timer 2 */ | |
83 | #define PITAUX_GATE2 0x01 /* aux port, PIT gate 2 input */ | |
84 | #define PITAUX_OUT2 0x02 /* aux port, PIT clock out 2 enable */ | |
85 | ||
86 | /* Following are used for Timer 0 */ | |
87 | #define PIT_C0 0x00 /* select counter 0 */ | |
88 | #define PIT_LOADMODE 0x30 /* load least significant byte followed | |
89 | * by most significant byte */ | |
90 | #define PIT_NDIVMODE 0x04 /*divide by N counter */ | |
91 | #define PIT_SQUAREMODE 0x06 /* square-wave mode */ | |
92 | ||
93 | /* Used for Timer 1. Used for delay calculations in countdown mode */ | |
94 | #define PIT_C1 0x40 /* select counter 1 */ | |
95 | #define PIT_READMODE 0x30 /* read or load least significant byte | |
96 | * followed by most significant byte */ | |
97 | #define PIT_RATEMODE 0x06 /* square-wave mode for USART */ | |
98 | ||
99 | /* | |
100 | * Clock speed for the timer in hz divided by the constant HZ | |
101 | * (defined in param.h) | |
102 | */ | |
103 | #define CLKNUM 1193167 | |
104 | ||
105 | #if EXL | |
106 | /* added micro-timer support. --- csy */ | |
107 | typedef struct time_latch { | |
108 | time_t ticks; /* time in HZ since boot */ | |
109 | time_t uticks; /* time in 1.25 MHZ */ | |
110 | /* don't need these two for now. --- csy */ | |
111 | /* time_t secs; \* seconds since boot */ | |
112 | /* time_t epochsecs; \* seconds since epoch */ | |
113 | } time_latch; | |
114 | /* a couple in-line assembly codes for efficiency. */ | |
115 | asm int intr_disable() | |
116 | { | |
117 | pushfl | |
118 | cli | |
119 | } | |
120 | ||
121 | asm int intr_restore() | |
122 | { | |
123 | popfl | |
124 | } | |
125 | ||
126 | #endif /* EXL */ |