OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [synth/] [arch/] [current/] [src/] [synth_protocol.h] - Blame information for rev 817

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_SYNTH_PROTOCOL_H
2
#define CYGONCE_HAL_SYNTH_PROTOCOL_H
3
 
4
//=============================================================================
5
//
6
//      synth_protocol.h
7
//
8
//      Generic protocol between eCos and the I/O auxiliary.
9
//
10
//=============================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
12
// -------------------------------------------                              
13
// This file is part of eCos, the Embedded Configurable Operating System.   
14
// Copyright (C) 2002 Free Software Foundation, Inc.                        
15
//
16
// eCos is free software; you can redistribute it and/or modify it under    
17
// the terms of the GNU General Public License as published by the Free     
18
// Software Foundation; either version 2 or (at your option) any later      
19
// version.                                                                 
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT      
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
24
// for more details.                                                        
25
//
26
// You should have received a copy of the GNU General Public License        
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
29
//
30
// As a special exception, if other files instantiate templates or use      
31
// macros or inline functions from this file, or you compile this file      
32
// and link it with other works to produce a work based on this file,       
33
// this file does not by itself cause the resulting work to be covered by   
34
// the GNU General Public License. However the source code for this file    
35
// must still be made available in accordance with section (3) of the GNU   
36
// General Public License v2.                                               
37
//
38
// This exception does not invalidate any other reasons why a work based    
39
// on this file might be covered by the GNU General Public License.         
40
// -------------------------------------------                              
41
// ####ECOSGPLCOPYRIGHTEND####                                              
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):   bartv
46
// Contributors:bartv
47
// Date:        2002-08-05
48
// Purpose:     Protocol definitions.
49
// Description: This header file defines the protocol used between the
50
//              synthetic target HAL and the I/O auxiliary. The relevant
51
//              code in the latter is implemented in Tcl (making
52
//              use of the "binary" command) so this header file is
53
//              not actually used on the host-side. Instead the protocol
54
//              is defined in terms of byte arrays.
55
//
56
//              The header file is not exported to any higher-level packages
57
//              that wish to communicate with the auxiliary. Instead those
58
//              packages are expected to use the functions synth_auxiliary_xchgmsg()
59
//              and synth_auxiliary_instantiate().
60
//
61
// Usage:       #include "synth_protocol.h"
62
//
63
//####DESCRIPTIONEND####
64
//
65
//=============================================================================
66
 
67
// Messages from the eCos synthetic target application to the I/O
68
// auxiliary are exactly 24 bytes long, consisting of six 32-bit
69
// little-endian integers. Inside the auxiliary they will be decoded
70
// using the Tcl binary scan command and the format i6. The top bit
71
// of RXLEN is overloaded to indicate whether or not a reply is expected
72
// at all.
73
#define SYNTH_REQUEST_LENGTH            24
74
#define SYNTH_REQUEST_DEVID_OFFSET       0
75
#define SYNTH_REQUEST_REQUEST_OFFSET     4
76
#define SYNTH_REQUEST_ARG1_OFFSET        8
77
#define SYNTH_REQUEST_ARG2_OFFSET       12
78
#define SYNTH_REQUEST_TXLEN_OFFSET      16
79
#define SYNTH_REQUEST_RXLEN_OFFSET      20
80
 
81
// And the response. This consists of two 32-bit little-endian integers,
82
// a result code and an actual rx_len field.
83
#define SYNTH_REPLY_LENGTH               8
84
#define SYNTH_REPLY_RESULT_OFFSET        0
85
#define SYNTH_REPLY_RXLEN_OFFSET         4
86
 
87
// Device 0 is special, it is for control messages with the auxiliary
88
// itself - for example, to instantiate a device.
89
#define SYNTH_DEV_AUXILIARY     0
90
 
91
// Requests intended directly for the auxiliary.
92
 
93
// Instantiate a device. arg1 and arg2 are ignored. The tx buffer
94
// holds a string for the given device. The rx buffer will be for a
95
// single integer, the device id or -1.
96
#define SYNTH_AUXREQ_INSTANTIATE                0x01
97
 
98
// Second-stage initialization, once all eCos device drivers have been
99
// activated.
100
#define SYNTH_AUXREQ_CONSTRUCTORS_DONE          0x02
101
 
102
// Get the current mask of pending interrupts. arg1 and arg2 are
103
// ignored, and there is no tx buffer. The reply code holds the irq
104
// pending mask. Normally there is no additional reply data, but if
105
// rx_len is non-zero then that indicates that the auxiliary has been
106
// asked to exit.
107
#define SYNTH_AUXREQ_GET_IRQPENDING             0x03
108
 
109
// Versioning. The core protocol cannot be changed without breaking
110
// lots of code. However it is still a good idea to allow the eCos
111
// application to verify that the host-side is the right version, in
112
// case new requests are added. arg1 and arg2 are ignored, there is no
113
// tx buffer or reply data, and the reply code holds the version.
114
#define SYNTH_AUXREQ_GET_VERSION                0x04
115
 
116
// The version has to be kept in synch with ecosynth.tcl
117
#define SYNTH_AUXILIARY_PROTOCOL_VERSION        0x01
118
 
119
// The console device is also provided by the architectural package,
120
// but only implements one function (write some output) so there is no
121
// need for any function codes.
122
 
123
#endif  // CYGONCE_HAL_SYNTH_PROTOCOL.H

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.