| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: remote.h |
| 5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
| 6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
| 7 | * |
| 8 | * The above named program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public |
| 10 | * License version 2 as published by the Free Software Foundation. |
| 11 | * |
| 12 | * The above named program is distributed in the hope that it will be |
| 13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public |
| 18 | * License along with this work; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 | * |
| 21 | * ========== Copyright Header End ============================================ |
| 22 | */ |
| 23 | //////////////////////////////////////////////////////////// |
| 24 | // |
| 25 | // File: remote.h |
| 26 | // |
| 27 | // Copyright (C) 2005 Sun Microsystems, Inc. |
| 28 | // All rights reserved. |
| 29 | // |
| 30 | |
| 31 | // header file for Remote Interface Module |
| 32 | |
| 33 | |
| 34 | const int MAX_PORT_STEP = 10; // DEFAULT_PORT to DEFAULT_PORT+9 |
| 35 | const int MAX_CONNECTIONS = 5; // allow upto 5 pending connections will never get that many |
| 36 | const int INTF_PORT = 9123; // port id |
| 37 | |
| 38 | |
| 39 | // signals from the target |
| 40 | const int SIGNAL_HUP = 1; |
| 41 | const int SIGNAL_QUIT = 3; |
| 42 | const int SIGNAL_BREAKPOINT = 5; |
| 43 | |
| 44 | |
| 45 | typedef struct |
| 46 | { |
| 47 | int port; // tcp port id, (i.e. 9123) |
| 48 | int port_step; |
| 49 | int max_connections; |
| 50 | int debug_on; |
| 51 | |
| 52 | } |
| 53 | RemoteConfig; |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | ///////////////////////////////////////////////////// |
| 62 | // |
| 63 | // Remote module exported interface |
| 64 | // |
| 65 | // when applicable return 0- if succeed, >0- if fail. |
| 66 | // |
| 67 | |
| 68 | typedef struct |
| 69 | { |
| 70 | |
| 71 | int (*create ) ( RemoteConfig *config ); |
| 72 | int (*update_status) ( int reason ); |
| 73 | int (*destroy) (); |
| 74 | |
| 75 | |
| 76 | } |
| 77 | RemoteExInterface; |
| 78 | |
| 79 | typedef int (*GetRemoteIntfFn)( RemoteExInterface *intf ); |
| 80 | |
| 81 | |
| 82 | |
| 83 | //////////////////////////////////////////////////////// |
| 84 | // |
| 85 | // Get exported interface from the Remote shared library. |
| 86 | // |
| 87 | // Assign function pointers in the interface structure. |
| 88 | // |
| 89 | // |
| 90 | // return: 0 - success; 1 - fail; |
| 91 | |
| 92 | extern "C" int get_ex_remote_interface |
| 93 | ( |
| 94 | RemoteExInterface *intf // pointer to the interface structure |
| 95 | ); |
| 96 | |
| 97 | |
| 98 | |
| 99 | |