File: molcpu.h

package info (click to toggle)
mol 0.9.61-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 6,140 kB
  • ctags: 8,491
  • sloc: ansic: 50,560; asm: 2,826; sh: 458; makefile: 373; perl: 165; lex: 135; yacc: 131
file content (69 lines) | stat: -rw-r--r-- 1,610 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
/* 
 *   Creation Date: <2001/01/31 21:02:05 samuel>
 *   Time-stamp: <2001/06/21 18:05:55 samuel>
 *   
 *	<molcpu.h>
 *	
 *	
 *   
 *   Copyright (C) 2001 Samuel Rydh (samuel@ibrium.se)
 *   
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation
 *   
 */

#ifndef _H_MOLCPU
#define _H_MOLCPU

#include "wrapper.h"

extern ulong g_session_magic;

/* Exports from mainloop.c and molcpu.c */

/* init / cleanup */
extern void	mainloop_init( void );
extern void	mainloop_cleanup( void );
extern void	mainloop_start( void );

extern void	molcpu_init( void );
extern void	molcpu_cleanup( void );

/* Emulation support */
extern void	irq_exception( void );
extern void	dec_exception( void );

/* interrupt emulation plays a central role in MOL */
extern void	interrupt_emulation();

/* flow control, mostly for the debugger */
extern void	stop_emulation( void );
extern void	resume_emulation( void );
extern void	quit_emulation( void );
extern void	save_session( void );

/* Debugger support */
extern void	set_break_flag( int flag );
extern void	clear_break_flag( int flag );

/* For mmu_cmds */
extern void	soft_trap( int trap_num );

/* In a few cases we need to know whether the *physical* processor is a 601 or not */
static inline int not_a_601( void ) {
	static int cached=-1;
	if( cached < 0 ) {
		ulong pvr;
		_get_pvr(&pvr);
		cached = !((pvr >> 16) == 1);
	}
	return cached;
}

#define is_a_601() (!not_a_601())

extern struct mac_regs *mregs;

#endif   /* _H_CPU_CONTROL */