File: 32bitmode.i

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 (45 lines) | stat: -rw-r--r-- 798 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
.macro	switch32bitmode

	/* is a 32bit aware ROM ? */

	movea.l	ROMBase,%a0
	move.w	8(%a0), %d1		/* read ROM id */

	cmp.w	#0x0178, %d1		/* only 24bit ROM */
	bls.S	bit32_ok

	/* is a 32bit aware processor ? */

	cmp.w	#1, CPUFlags	/* Is 68000 or 68010 */
	bls.S	bit32_ok

	/* test if we are in 32bit mode */

	move.l	#-1, %d0
	StripAddress
	cmp.l	#-1, %d0
	beq.S	bit32_ok

	/* Switch to 32bit mode */

	lea	PRAM_buffer(%pc), %a0	/* where to store data */
	move.w	#1, %d0			/* size of data */
	swap	%d0
	move.w	#0x08A, %d0		/* offset in PRAM */
	ReadXPRam

	lea	PRAM_buffer(%pc), %a0
	or.b	#0x05, (%a0)

	move.w	#1, %d0			/* size of data */
	swap	%d0
	move.w	#0x08A, %d0		/* offset in PRAM */
	WriteXPRam
	
	/* jump to reset function in ROM */

	movea.l	ROMBase,%a0
	jmp	0x90(%a0)

bit32_ok:
.endm