~ubuntu-branches/ubuntu/lucid/skyeye/lucid-proposed

« back to all changes in this revision

Viewing changes to arch/mips/common/mipsio.c

  • Committer: Bazaar Package Importer
  • Author(s): Yu Guanghui
  • Date: 2007-08-07 13:25:49 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20070807132549-96159k1obat1fxr0
Tags: 1.2.3-1
* New upstream release
* Added NO_BFD=1, don't require libbfd now. (Closes:Bug#423933) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "types.h"
2
2
#include "emul.h"
3
3
 
 
4
#include "skyeye_config.h"
 
5
 
4
6
extern MIPS_State *mstate;
5
7
 
6
8
UInt32
7
9
mips_io_read_byte(UInt32 addr)
8
10
{
9
 
        if (mstate->p_mach->io_read_byte)
10
 
                return mstate->p_mach->io_read_byte(addr);
 
11
        if (skyeye_config.mach->mach_io_read_byte)
 
12
                return skyeye_config.mach->mach_io_read_byte(mstate, addr);
11
13
        else
12
14
                return 0;
13
15
}
15
17
UInt32
16
18
mips_io_read_halfword(UInt32 addr)
17
19
{       
18
 
        if (mstate->p_mach->io_read_halfword)
19
 
                return mstate->p_mach->io_read_halfword(addr);
 
20
        if (skyeye_config.mach->mach_io_read_halfword)
 
21
                return skyeye_config.mach->mach_io_read_halfword(mstate, addr);
20
22
        else
21
23
                return 0;
22
24
}
25
27
mips_io_read_word(UInt32 addr)
26
28
{
27
29
        
28
 
        if (mstate->p_mach->io_read_word)
29
 
                return mstate->p_mach->io_read_word(addr);
 
30
        if (skyeye_config.mach->mach_io_read_word)
 
31
                return skyeye_config.mach->mach_io_read_word(mstate, addr);
30
32
        else
31
33
                return 0;
32
34
}
41
43
mips_io_write_byte(UInt32 addr, UInt32 data)
42
44
{
43
45
        
44
 
        if (mstate->p_mach->io_write_byte)
45
 
                mstate->p_mach->io_write_byte(addr, data);
 
46
        if (skyeye_config.mach->mach_io_write_byte)
 
47
                skyeye_config.mach->mach_io_write_byte(mstate, addr, data);
46
48
}
47
49
 
48
50
void
49
51
mips_io_write_halfword(UInt32 addr, UInt32 data)
50
52
{
51
53
        
52
 
        if (mstate->p_mach->io_write_halfword)
53
 
                mstate->p_mach->io_write_halfword(addr, data);
 
54
        if (skyeye_config.mach->mach_io_write_halfword)
 
55
                skyeye_config.mach->mach_io_write_halfword(mstate, addr, data);
54
56
}
55
57
 
56
58
void
57
59
mips_io_write_word(UInt32 addr, UInt32 data)
58
60
{
59
61
        
60
 
        if (mstate->p_mach->io_write_word)
61
 
                mstate->p_mach->io_write_word(addr, data);
 
62
        if (skyeye_config.mach->mach_io_write_word)
 
63
                skyeye_config.mach->mach_io_write_word(mstate, addr, data);
62
64
}
63
65
 
64
66
void