1 |
56 |
joel |
/* nullmon.c - Stub or monitor services.
|
2 |
|
|
*
|
3 |
|
|
* Copyright (c) 1998 Cygnus Support
|
4 |
|
|
*
|
5 |
|
|
* The authors hereby grant permission to use, copy, modify, distribute,
|
6 |
|
|
* and license this software and its documentation for any purpose, provided
|
7 |
|
|
* that existing copyright notices are retained in all copies and that this
|
8 |
|
|
* notice is included verbatim in any distributions. No written agreement,
|
9 |
|
|
* license, or royalty fee is required for any of the authorized uses.
|
10 |
|
|
* Modifications to this software may be copyrighted by their authors
|
11 |
|
|
* and need not follow the licensing terms described here, provided that
|
12 |
|
|
* the new terms are clearly indicated on the first page of each file where
|
13 |
|
|
* they apply.
|
14 |
|
|
*/
|
15 |
|
|
|
16 |
|
|
/* This is a ROMSTUB
|
17 |
|
|
Various libraries in libgloss may reference board specific services.
|
18 |
|
|
These are often performed by system calls and by rom specific
|
19 |
|
|
interfaces such as dvemon.c This file defines the null interface in
|
20 |
|
|
which the rom monitor either does not exist or is not used.
|
21 |
|
|
Linking with this file supports applications which only exercise
|
22 |
|
|
the processor, specifically, the GDB test suite.
|
23 |
|
|
By linking this object in rather than a monitor specific support
|
24 |
|
|
we can insure that the testsuite will run without references or
|
25 |
|
|
linkages to nonexistent monitor services.
|
26 |
|
|
Similarly, every service provided by this file muse be provided by all
|
27 |
|
|
monitor speciifc interfaces.
|
28 |
|
|
PLEASE DO NOT MAKE THIS FILE SPECIFIC TO ANY MONITOR
|
29 |
|
|
*/
|
30 |
|
|
|
31 |
|
|
/* This form is giving linker relocation errors */
|
32 |
|
|
#if ! defined(BOARD_MEM_SIZE)
|
33 |
|
|
#define BOARD_MEM_SIZE 0x100000 /* About a megabyte */
|
34 |
|
|
#endif
|
35 |
|
|
extern unsigned char _ftext ; /* Defined in nullmon.ld */
|
36 |
|
|
extern unsigned char _end ; /* Defined in nullmon.ld */
|
37 |
|
|
|
38 |
|
|
#if defined(FIXME_WARNINGS)
|
39 |
|
|
#warning("FIXME: struct s_mem belongs in a header file")
|
40 |
|
|
#endif
|
41 |
|
|
struct s_mem
|
42 |
|
|
{ unsigned int size;
|
43 |
|
|
unsigned int icsize;
|
44 |
|
|
unsigned int dcsize;
|
45 |
|
|
};
|
46 |
|
|
|
47 |
|
|
void
|
48 |
|
|
get_mem_info (mem)
|
49 |
|
|
struct s_mem *mem;
|
50 |
|
|
{ char * t1, * t2 ;
|
51 |
|
|
unsigned long long tmp ;
|
52 |
|
|
t1 = & _ftext ;
|
53 |
|
|
t2 = & _end ;
|
54 |
|
|
tmp = (unsigned long long) (t2 - t1) ;
|
55 |
|
|
tmp = (unsigned long long) BOARD_MEM_SIZE - tmp ;
|
56 |
|
|
mem->size = tmp ;
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
/* SYSTEM INTERFACE
|
60 |
|
|
Since we are defining a NULL operating environment here, I am
|
61 |
|
|
entering the stub definitions for the GNUpro libraries, System Calls.
|
62 |
|
|
I would rather not to even pretend to support these functions but, they
|
63 |
|
|
get pulled in by other libraries.
|
64 |
|
|
*/
|
65 |
|
|
|
66 |
|
|
int read(int file, char * ptr , int len) { return 0 ; }
|
67 |
|
|
int close (int file) { return -1 ; }
|
68 |
|
|
int write(int file , char * ptr, int len) { return 0 ; }
|
69 |
|
|
/*eof*/
|