constify more driver lists and related structures to cut down on .data size

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1788 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent 925056da02
commit 792cf1b3f2

@ -14,6 +14,18 @@
fix local types so we don't mismatch signs, and avoid leaking register
allocations with the error handling.
* include/urjtag/bfin.h (scans), include/urjtag/bus.h (urj_bus_drivers),
include/urjtag/cable.h (urj_tap_cable_drivers), include/urjtag/flash.h
(urj_flash_flash_drivers), include/urjtag/params.h (urj_param_list_t.list),
include/urjtag/parport.h (urj_tap_parport_drivers),
include/urjtag/usbconn.h (urj_tap_usbconn_drivers), src/bfin/bfin.c
(scans), src/bus/buses.c (urj_bus_drivers, bus_param), src/flash/flash.c
(urj_flash_flash_drivers), src/tap/cable.c (urj_tap_cable_drivers),
src/tap/cable/generic_usbconn.c (urj_tap_cable_usbconn_cables),
src/tap/parport.c (urj_tap_parport_drivers), src/tap/usbconn.c
(urj_tap_usbconn_drivers): Constify drivers lists and a few related
structures to share more unmutable data in .rodata.
2010-05-19 Arnim Laeuger <arniml>
* src/flash/amd.c, doc/UrJTAG.txt: [ 2996919 ] Support for MX29LV320C

@ -170,7 +170,7 @@ extern struct emu_oab bfin_emu_oab;
#define EMUIR64_SCAN 7
#define NUM_SCANS 8
extern const char *scans[];
extern const char * const scans[];
#define INSN_NOP 0x0000
#define INSN_RTE 0x0014

@ -46,7 +46,7 @@ typedef struct
urj_buses_t;
extern urj_buses_t urj_buses;
extern const urj_bus_driver_t *urj_bus_drivers[];
extern const urj_bus_driver_t * const urj_bus_drivers[];
void urj_bus_buses_free (void);
int urj_bus_buses_add (urj_bus_t *abus);

@ -238,7 +238,7 @@ urj_cable_t *urj_tap_cable_other_connect (urj_chain_t *chain,
const urj_cable_driver_t *driver,
const urj_param_t *params[]);
extern const urj_cable_driver_t *urj_tap_cable_drivers[];
extern const urj_cable_driver_t * const urj_tap_cable_drivers[];
/** The list of recognized parameters */
extern const urj_param_list_t urj_cable_param_list;

@ -60,7 +60,7 @@ typedef struct
}
urj_flash_driver_t;
extern const urj_flash_driver_t *urj_flash_flash_drivers[];
extern const urj_flash_driver_t * const urj_flash_flash_drivers[];
/** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
int urj_flash_detectflash (urj_log_level_t ll, urj_bus_t *bus, uint32_t adr);

@ -81,8 +81,8 @@ urj_param_descr_t;
*/
typedef struct URJ_PARAM_LIST
{
urj_param_descr_t *list;
size_t n;
const urj_param_descr_t *list;
size_t n;
}
urj_param_list_t;

@ -78,6 +78,6 @@ int urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data);
const char *urj_cable_parport_devtype_string(urj_cable_parport_devtype_t dt);
extern const urj_parport_driver_t *urj_tap_parport_drivers[];
extern const urj_parport_driver_t * const urj_tap_parport_drivers[];
#endif /* URJ_PARPORT_H */

@ -70,6 +70,6 @@ int urj_tap_usbconn_close (urj_usbconn_t *conn);
int urj_tap_usbconn_read (urj_usbconn_t *conn, uint8_t *buf, int len);
int urj_tap_usbconn_write (urj_usbconn_t *conn, uint8_t *buf, int len,
int recv);
extern const urj_usbconn_driver_t *urj_tap_usbconn_drivers[];
extern const urj_usbconn_driver_t * const urj_tap_usbconn_drivers[];
#endif /* URJ_USBCONN_H */

@ -32,7 +32,7 @@
#include <urjtag/bfin.h>
#include "bfin-part.h"
const char *scans[] = {
const char * const scans[] = {
"IDCODE",
"DBGSTAT_SCAN",
"DBGCTL_SCAN",

@ -35,7 +35,7 @@
#include "buses.h"
const urj_bus_driver_t *urj_bus_drivers[] = {
const urj_bus_driver_t * const urj_bus_drivers[] = {
#define _URJ_BUS(bus) &urj_bus_##bus##_bus,
#include "buses_list.h"
NULL /* last must be NULL */
@ -180,7 +180,7 @@ urj_bus_init_bus (urj_chain_t *chain, const urj_bus_driver_t *bus_driver,
return abus;
}
static urj_param_descr_t bus_param[] =
static const urj_param_descr_t bus_param[] =
{
{ URJ_BUS_PARAM_KEY_MUX, URJ_PARAM_TYPE_BOOL, "MUX", },
{ URJ_BUS_PARAM_KEY_OCD, URJ_PARAM_TYPE_BOOL, "OCD", },

@ -51,7 +51,7 @@
#include "intel.h"
#include "amd.h"
const urj_flash_driver_t *urj_flash_flash_drivers[] = {
const urj_flash_driver_t * const urj_flash_flash_drivers[] = {
&urj_flash_amd_32_flash_driver,
&urj_flash_amd_16_flash_driver,
&urj_flash_amd_8_flash_driver,

@ -45,7 +45,7 @@
#include "cable.h"
const urj_cable_driver_t *urj_tap_cable_drivers[] = {
const urj_cable_driver_t * const urj_tap_cable_drivers[] = {
#define _URJ_CABLE(cable) &urj_tap_cable_##cable##_driver,
#include "cable_list.h"
NULL /* last must be NULL */
@ -664,7 +664,7 @@ urj_tap_cable_other_connect (urj_chain_t *chain, const urj_cable_driver_t *drive
return cable;
}
static urj_param_descr_t cable_param[] =
static const urj_param_descr_t cable_param[] =
{
{ URJ_CABLE_PARAM_KEY_PID, URJ_PARAM_TYPE_LU, "pid", },
{ URJ_CABLE_PARAM_KEY_VID, URJ_PARAM_TYPE_LU, "vid", },

@ -35,7 +35,7 @@
#include <urjtag/cmd.h>
const urj_usbconn_cable_t *urj_tap_cable_usbconn_cables[] = {
static const urj_usbconn_cable_t * const urj_tap_cable_usbconn_cables[] = {
#define _URJ_USB(usb) &urj_tap_cable_usbconn_##usb,
#include "generic_usbconn_list.h"
NULL

@ -30,7 +30,7 @@
#include "parport.h"
const urj_parport_driver_t *urj_tap_parport_drivers[] = {
const urj_parport_driver_t *const urj_tap_parport_drivers[] = {
#define _URJ_LIST(item) &urj_tap_parport_##item##_driver,
#include "parport_list.h"
NULL /* last must be NULL */

@ -31,7 +31,7 @@
#include "usbconn.h"
const urj_usbconn_driver_t *urj_tap_usbconn_drivers[] = {
const urj_usbconn_driver_t * const urj_tap_usbconn_drivers[] = {
#define _URJ_LIST(item) &urj_tap_usbconn_##item##_driver,
#include "usbconn_list.h"
NULL /* last must be NULL */

Loading…
Cancel
Save