]>
Commit | Line | Data |
---|---|---|
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 | Emulate.s | |
24 | ||
25 | Emulate instructions and traps. | |
26 | ||
27 | Lovingly crafted by Bill Angell using traditional methods and only natural or recycled materials. | |
28 | No animal products are used other than rendered otter bile and deep fried pork lard. | |
29 | ||
30 | */ | |
31 | ||
32 | #include <cpus.h> | |
33 | #include <ppc/asm.h> | |
34 | #include <ppc/proc_reg.h> | |
35 | #include <ppc/exception.h> | |
36 | #include <mach/machine/vm_param.h> | |
37 | #include <assym.s> | |
38 | ||
39 | ||
40 | ; General stuff what happens here: | |
41 | ; 1) All general context saved, interrupts off, translation off | |
42 | ; 2) Vector and floating point disabled, but there may be live context. | |
43 | ; This code is responsible for saving and restoring what is used. This | |
44 | ; includes exception states, java mode, etc. | |
45 | ; 3) No attempt is made to resolve page faults. PTE misses are handled | |
46 | ; automatically, but actual faults (ala copyin/copyout) are not. If | |
47 | ; a fault does occur, the exception that caused entry to the emulation | |
48 | ; routine is remapped to either an instruction or data miss (depending | |
49 | ; upon the stage detected) and redrived through the exception handler. | |
50 | ; The only time that an instruction fault can happen is when a different | |
51 | ; processor removes a mapping between our original fault and when we | |
52 | ; fetch the assisted instruction. For an assisted instruction, data | |
53 | ; faults should not occur (except in the MP case). For a purely | |
54 | ; emulated instruction, faults can occur. | |
55 | ; | |
56 | ; | |
57 | ||
58 | ||
59 | .align 5 | |
60 | .globl EXT(Emulate) | |
61 | ||
62 | LEXT(Emulate) | |
63 | ||
64 | b EXT(EmulExit) ; Just return for now... | |
65 |