server: bind to IPv4 localhost by default
[fw/openocd] / src / target / image.h
index 9741308ebb543cee92e366e55824f0076664c948..9907a5f3fbca180b080d46eae257632b5d4f07a2 100644 (file)
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
-#ifndef IMAGE_H
-#define IMAGE_H
+#ifndef OPENOCD_TARGET_IMAGE_H
+#define OPENOCD_TARGET_IMAGE_H
 
 #include <helper/fileio.h>
 
@@ -48,7 +46,7 @@ enum image_type {
 };
 
 struct imagesection {
-       uint32_t base_address;
+       target_addr_t base_address;
        uint32_t size;
        int flags;
        void *private;          /* private data */
@@ -66,11 +64,11 @@ struct image {
 };
 
 struct image_binary {
-       struct fileio fileio;
+       struct fileio *fileio;
 };
 
 struct image_ihex {
-       struct fileio fileio;
+       struct fileio *fileio;
        uint8_t *buffer;
 };
 
@@ -81,7 +79,7 @@ struct image_memory {
 };
 
 struct image_elf {
-       struct fileio fileio;
+       struct fileio *fileio;
        Elf32_Ehdr *header;
        Elf32_Phdr *segments;
        uint32_t segment_count;
@@ -89,7 +87,7 @@ struct image_elf {
 };
 
 struct image_mot {
-       struct fileio fileio;
+       struct fileio *fileio;
        uint8_t *buffer;
 };
 
@@ -99,7 +97,7 @@ int image_read_section(struct image *image, int section, uint32_t offset,
 void image_close(struct image *image);
 
 int image_add_section(struct image *image, uint32_t base, uint32_t size,
-               int flags, uint8_t *data);
+               int flags, uint8_t const *data);
 
 int image_calculate_checksum(uint8_t *buffer, uint32_t nbytes,
                uint32_t *checksum);
@@ -109,4 +107,4 @@ int image_calculate_checksum(uint8_t *buffer, uint32_t nbytes,
 #define ERROR_IMAGE_TEMPORARILY_UNAVAILABLE            (-1402)
 #define ERROR_IMAGE_CHECKSUM           (-1403)
 
-#endif /* IMAGE_H */
+#endif /* OPENOCD_TARGET_IMAGE_H */