SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ProcMgr.h
Go to the documentation of this file.
1 
36 /*
37  * ============================================================================
38  *
39  * Copyright (c) 2008-2012, Texas Instruments Incorporated
40  *
41  * Redistribution and use in source and binary forms, with or without
42  * modification, are permitted provided that the following conditions
43  * are met:
44  *
45  * * Redistributions of source code must retain the above copyright
46  * notice, this list of conditions and the following disclaimer.
47  *
48  * * Redistributions in binary form must reproduce the above copyright
49  * notice, this list of conditions and the following disclaimer in the
50  * documentation and/or other materials provided with the distribution.
51  *
52  * * Neither the name of Texas Instruments Incorporated nor the names of
53  * its contributors may be used to endorse or promote products derived
54  * from this software without specific prior written permission.
55  *
56  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
57  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
58  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
60  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
61  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
62  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
63  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
64  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
65  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
66  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67  * Contact information for paper mail:
68  * Texas Instruments
69  * Post Office Box 655303
70  * Dallas, Texas 75265
71  * Contact information:
72  * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
73  * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
74  * ============================================================================
75  *
76  */
77 
78 
79 #ifndef ProcMgr_H_0xf2ba
80 #define ProcMgr_H_0xf2ba
81 
82 #if defined (__cplusplus)
83 extern "C" {
84 #endif
85 
86 
87 /* =============================================================================
88  * All success and failure codes for the module
89  * =============================================================================
90  */
94 #define ProcMgr_S_SETUP 5
95 
99 #define ProcMgr_S_OPENHANDLE 4
100 
104 #define ProcMgr_S_ALREADYEXISTS 3
105 
108 #define ProcMgr_S_BUSY 2
109 
113 #define ProcMgr_S_ALREADYSETUP 1
114 
118 #define ProcMgr_S_SUCCESS 0
119 
123 #define ProcMgr_E_FAIL -1
124 
128 #define ProcMgr_E_INVALIDARG -2
129 
133 #define ProcMgr_E_MEMORY -3
134 
138 #define ProcMgr_E_ALREADYEXISTS -4
139 
143 #define ProcMgr_E_NOTFOUND -5
144 
148 #define ProcMgr_E_TIMEOUT -6
149 
153 #define ProcMgr_E_INVALIDSTATE -7
154 
158 #define ProcMgr_E_OSFAILURE -8
159 
163 #define ProcMgr_E_RESOURCE -9
164 
168 #define ProcMgr_E_RESTART -10
169 
173 #define ProcMgr_E_HANDLE -11
174 
178 #define ProcMgr_E_ACCESSDENIED -12
179 
183 #define ProcMgr_E_TRANSLATE -13
184 
188 #define ProcMgr_E_SYMBOLNOTFOUND -14
189 
193 #define ProcMgr_E_MAP -15
194 
195 
196 /* =============================================================================
197  * Macros and types
198  * =============================================================================
199  */
203 #define IS_VALID_PROCID(id) (id < MultiProc_MAXPROCESSORS)
204 
208 typedef struct ProcMgr_Object * ProcMgr_Handle;
209 
210 
214 typedef enum {
229 } ProcMgr_State ;
230 
234 typedef enum {
250 
254 typedef enum {
268 
273 
277 #define ProcMgr_MASTERKNLVIRT (ProcMgr_MapMask)(1 << 0)
278 
282 #define ProcMgr_MASTERUSRVIRT (ProcMgr_MapMask)(1 << 1)
283 
287 #define ProcMgr_SLAVEVIRT (ProcMgr_MapMask)(1 << 2)
288 
292 typedef struct ProcMgr_AttachParams_tag {
295  Ptr bootParams;
298 
303 typedef struct ProcMgr_StartParams_tag {
307 
308 
313 typedef struct ProcMgr_AddrInfo_tag {
316  UInt32 size;
318  Bool isCached;
320  Bool isMapped;
322  ProcMgr_MapMask mapMask;
328 
332 typedef struct ProcMgr_MappedMemEntry {
337  ProcMgr_MapMask mapMask;
339  Bool inUse;
342 
346 typedef struct ProcMgr_ProcInfo_tag {
356 
357 
361 typedef struct ProcMgr_SectionInfo_tag {
366  UInt16 sectId;
368  UInt32 size;
371 
372 
373 /* =============================================================================
374  * APIs
375  * =============================================================================
376  */
399 Int ProcMgr_open (ProcMgr_Handle * handlePtr, UInt16 procId);
400 
422 Int ProcMgr_close (ProcMgr_Handle * handlePtr);
423 
441 Void ProcMgr_getAttachParams (ProcMgr_Handle handle,
442  ProcMgr_AttachParams * params);
443 
489 Int ProcMgr_attach (ProcMgr_Handle handle, ProcMgr_AttachParams * params);
490 
514 Int ProcMgr_detach (ProcMgr_Handle handle);
515 
549 Int ProcMgr_load (ProcMgr_Handle handle,
550  String imagePath,
551  UInt32 argc,
552  String * argv,
553  Ptr params,
554  UInt32 * fileId);
555 
578 Int ProcMgr_unload (ProcMgr_Handle handle, UInt32 fileId);
579 
598 Void ProcMgr_getStartParams (ProcMgr_Handle handle,
599  ProcMgr_StartParams * params);
600 
625 Int ProcMgr_start (ProcMgr_Handle handle, ProcMgr_StartParams * params);
626 
644 Int ProcMgr_stop (ProcMgr_Handle handle);
645 
658 ProcMgr_State ProcMgr_getState (ProcMgr_Handle handle);
659 
691 Int ProcMgr_read (ProcMgr_Handle handle,
692  UInt32 procAddr,
693  UInt32 * numBytes,
694  Ptr buffer);
695 
724 Int ProcMgr_write (ProcMgr_Handle handle,
725  UInt32 procAddr,
726  UInt32 * numBytes,
727  Ptr buffer);
728 
747 Int ProcMgr_control (ProcMgr_Handle handle, Int32 cmd, Ptr arg);
748 
772 Int ProcMgr_translateAddr (ProcMgr_Handle handle,
773  Ptr * dstAddr,
774  ProcMgr_AddrType dstAddrType,
775  Ptr srcAddr,
776  ProcMgr_AddrType srcAddrType);
777 
794 Int ProcMgr_getSymbolAddress (ProcMgr_Handle handle,
795  UInt32 fileId,
796  String symbolName,
797  UInt32 * symValue);
798 
826 Int ProcMgr_map (ProcMgr_Handle handle,
827  ProcMgr_MapMask mapMask,
828  ProcMgr_AddrInfo * addrInfo,
829  ProcMgr_AddrType srcAddrType);
830 
863 Int ProcMgr_unmap (ProcMgr_Handle handle,
864  ProcMgr_MapMask mapMask,
865  ProcMgr_AddrInfo * addrInfo,
866  ProcMgr_AddrType srcAddrType);
867 
879 UInt32 ProcMgr_getMaxMemoryRegions(ProcMgr_Handle handle);
880 
881 
894 Int ProcMgr_getProcInfo (ProcMgr_Handle handle,
895  ProcMgr_ProcInfo * procInfo);
896 
897 
913 Int ProcMgr_getSectionInfo (ProcMgr_Handle handle,
914  UInt32 fileId,
915  String sectionName,
916  ProcMgr_SectionInfo * sectionInfo);
917 
935 Int ProcMgr_getSectionData (ProcMgr_Handle handle,
936  UInt32 fileId,
937  ProcMgr_SectionInfo * sectionInfo,
938  Ptr buffer);
939 
940 
951 UInt32 ProcMgr_getLoadedFileId (ProcMgr_Handle handle);
952 
953 
954 #if defined (__cplusplus)
955 }
956 #endif /* defined (__cplusplus) */
957 
958 #endif /* ProcMgr_H_0xf2ba */
Copyright 2014, Texas Instruments Incorporated