2 # This file is Copyright 2003, 2006, 2007, 2009, 2010 Dean Hall.
4 # This file is part of the PyMite VM.
5 # The PyMite VM is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
8 # The PyMite VM is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
12 # is seen in the file COPYING in this directory.
24 * Created to eliminate a circular include
25 * among mem, string and obj.
29 /** The maximum number of paths available in PmImgPaths */
30 #define PM_NUM_IMG_PATHS 4
33 typedef struct PmImgPaths_s
35 PmMemSpace_t memspace
[PM_NUM_IMG_PATHS
];
36 uint8_t const *pimg
[PM_NUM_IMG_PATHS
];
39 PmImgPaths_t
, *pPmImgPaths_t
;
45 * A type to hold code images in the heap.
46 * A code image with an object descriptor at the front.
47 * Used for storing image objects during ipm;
48 * the code object keeps a reference to this object.
50 typedef struct PmCodeImgObj_s
52 /** Object descriptor */
55 /** Null-term? char array */
62 * Iterates over all paths in the paths array until the named module is found.
63 * Returns the memspace,address of the head of the module.
65 * @param pname Pointer to the name of the desired module
66 * @param r_memspace Return by reference the memory space of the module
67 * @param r_imgaddr Return by reference the address of the module's image
68 * @return Return status
70 PmReturn_t
img_findInPaths(pPmObj_t pname
, PmMemSpace_t
*r_memspace
,
71 uint8_t const **r_imgaddr
);
74 * Appends the given memspace and address to the image path array
76 * @param memspace The memspace
77 * @param paddr The address
78 * @return Return status
80 PmReturn_t
img_appendToPath(PmMemSpace_t memspace
, uint8_t const * const paddr
);
82 #endif /* __IMG_H__ */