File: enter_kernel.c

package info (click to toggle)
emile 0.10-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,716 kB
  • ctags: 2,737
  • sloc: ansic: 18,908; makefile: 726; asm: 622; sh: 2
file content (70 lines) | stat: -rw-r--r-- 1,458 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 *
 * (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
 *
 */

#include <stdio.h>

#include <macos/types.h>
#include <macos/gestalt.h>

#include "misc.h"
#include "arch.h"
#include "enter_kernel.h"

unsigned long enter_kernel;
unsigned long end_enter_kernel;
disable_cache_t disable_cache;

void enter_kernel_init(void)
{
#ifdef ARCH_M68K
	if (arch_type == gestalt68k)
	{
		if (mmu_type == gestalt68040MMU)
		{
#ifdef USE_MMU040
			enter_kernel = (unsigned long)enter_kernel040;
			end_enter_kernel = (unsigned long)&end_enter_kernel040;
			disable_cache = MMU040_disable_cache;
#else
			error("68040 MMU is not supported");
#endif
		}
		else if (mmu_type == gestalt68030MMU)
		{
#ifdef USE_MMU030
			enter_kernel = (unsigned long)enter_kernel030;
			end_enter_kernel = (unsigned long)&end_enter_kernel030;
			disable_cache = MMU030_disable_cache;
#else
			error("68030 MMU is not supported");
#endif
		}
		else if (mmu_type == gestalt68851)
		{
			error("MMU 68851 is not supported");
		}
		else if (mmu_type == gestaltNoMMU)
		{
			enter_kernel = (unsigned long)enter_kernelnoMMU;
			end_enter_kernel = (unsigned long)&end_enter_kernelnoMMU;
			disable_cache = noMMU_disable_cache;
		}
		else
			error("Unsupported MMU");
	}
#endif
#ifdef ARCH_PPC
	if (arch_type == gestaltPowerPC)
	{
		enter_kernel = NULL;
		end_enter_kernel = NULL;
		disable_cache = NULL;
		bootstrap_size = 0;
	}
	else
		error("EMILE doesn't support your architecture");
#endif
}