diff --git a/api/etherbone.h b/api/etherbone.h index 13d43740d2bbc47d0caed24d886532dc44516936..91549f111a87ee68055c5d8965263a4a7a18eca3 100644 --- a/api/etherbone.h +++ b/api/etherbone.h @@ -172,8 +172,8 @@ struct sdb_product { /* 56 bytes, 8-byte alignment */ struct sdb_component { - uint64_t begin; /* Address range: [begin, end] */ - uint64_t end; + uint64_t addr_first; /* Address range: [addr_first, addr_last] */ + uint64_t addr_last; struct sdb_product product; }; @@ -192,7 +192,7 @@ typedef struct sdb_interconnect { uint16_t sdb_records; /* Length of the SDB table (including header) */ uint8_t sdb_version; /* 1 */ uint8_t sdb_bus_type; /* sdb_bus_type */ - struct sdb_component component; + struct sdb_component sdb_component; } *sdb_interconnect_t; /* Record type: sdb_integration @@ -219,7 +219,7 @@ typedef struct sdb_device { uint8_t abi_ver_major; uint8_t abi_ver_minor; uint32_t bus_specific; - struct sdb_component component; + struct sdb_component sdb_component; } *sdb_device_t; /* Record type: sdb_bridge @@ -229,7 +229,7 @@ typedef struct sdb_device { */ typedef struct sdb_bridge { uint64_t sdb_child; /* Nested SDB table */ - struct sdb_component component; + struct sdb_component sdb_component; } *sdb_bridge_t; /* All possible SDB record structure */ diff --git a/api/glue/handler.c b/api/glue/handler.c index aa15377d196821099b635c5d19ad46f6bfacf205..2863a4b250f98edf291815b575b3abceaaa4a8d2 100644 --- a/api/glue/handler.c +++ b/api/glue/handler.c @@ -39,8 +39,8 @@ eb_status_t eb_socket_attach(eb_socket_t socketp, eb_handler_t handler) { struct eb_socket* socket; struct eb_handler_address* address; struct eb_handler_callback* callback; - eb_address_t new_begin, new_end; - eb_address_t dev_begin, dev_end; + eb_address_t new_first, new_last; + eb_address_t dev_first, dev_last; /* Get memory */ addressp = eb_new_handler_address(); @@ -53,15 +53,15 @@ eb_status_t eb_socket_attach(eb_socket_t socketp, eb_handler_t handler) { return EB_OOM; } - new_begin = handler->device->component.begin; - new_end = handler->device->component.end; + new_first = handler->device->sdb_component.addr_first; + new_last = handler->device->sdb_component.addr_last; /* Is the address range supported by our bus size? */ - if (new_begin != handler->device->component.begin || new_end != handler->device->component.end) + if (new_first != handler->device->sdb_component.addr_first || new_last != handler->device->sdb_component.addr_last) return EB_ADDRESS; /* Does it overlap out reserved memory range? */ - if (new_begin < 0x4000) return EB_ADDRESS; + if (new_first < 0x4000) return EB_ADDRESS; socket = EB_SOCKET(socketp); @@ -69,11 +69,11 @@ eb_status_t eb_socket_attach(eb_socket_t socketp, eb_handler_t handler) { for (i = socket->first_handler; i != EB_NULL; i = address->next) { address = EB_HANDLER_ADDRESS(i); - dev_begin = address->device->component.begin; - dev_end = address->device->component.end; + dev_first = address->device->sdb_component.addr_first; + dev_last = address->device->sdb_component.addr_last; /* Do the address ranges overlap? */ - if (new_begin <= dev_end && dev_begin <= new_end) { + if (new_first <= dev_last && dev_first <= new_last) { eb_free_handler_callback(callbackp); eb_free_handler_address(addressp); return EB_ADDRESS; diff --git a/api/glue/readwrite.c b/api/glue/readwrite.c index 4538ac59cbd6acb3ae65e24692002cb2e2f0e8af..ea4d5e7226636fc9b5d44448db4f54472f55bd8a 100644 --- a/api/glue/readwrite.c +++ b/api/glue/readwrite.c @@ -130,7 +130,7 @@ void eb_socket_write(eb_socket_t socketp, eb_width_t widths, eb_address_t addr_b eb_handler_address_t addressp; struct eb_handler_address* address; struct eb_socket* socket; - eb_address_t dev_begin, dev_end; + eb_address_t dev_first, dev_last; int fail; /* SDB address? It's read only ... */ @@ -142,9 +142,9 @@ void eb_socket_write(eb_socket_t socketp, eb_width_t widths, eb_address_t addr_b socket = EB_SOCKET(socketp); for (addressp = socket->first_handler; addressp != EB_NULL; addressp = address->next) { address = EB_HANDLER_ADDRESS(addressp); - dev_begin = address->device->component.begin; - dev_end = address->device->component.end; - if (dev_begin <= addr_b && addr_b <= dev_end) break; + dev_first = address->device->sdb_component.addr_first; + dev_last = address->device->sdb_component.addr_last; + if (dev_first <= addr_b && addr_b <= dev_last) break; } if (addressp == EB_NULL) { @@ -199,7 +199,7 @@ eb_data_t eb_socket_read(eb_socket_t socketp, eb_width_t widths, eb_address_t ad eb_handler_address_t addressp; struct eb_handler_address* address; struct eb_socket* socket; - eb_address_t dev_begin, dev_end; + eb_address_t dev_first, dev_last; int fail; /* SDB address? */ @@ -211,9 +211,9 @@ eb_data_t eb_socket_read(eb_socket_t socketp, eb_width_t widths, eb_address_t ad socket = EB_SOCKET(socketp); for (addressp = socket->first_handler; addressp != EB_NULL; addressp = address->next) { address = EB_HANDLER_ADDRESS(addressp); - dev_begin = address->device->component.begin; - dev_end = address->device->component.end; - if (dev_begin <= addr_b && addr_b <= dev_end) break; + dev_first = address->device->sdb_component.addr_first; + dev_last = address->device->sdb_component.addr_last; + if (dev_first <= addr_b && addr_b <= dev_last) break; } if (addressp == EB_NULL) { diff --git a/api/glue/sdb.c b/api/glue/sdb.c index 03a9942482f52bd313b910f2bf27cdcb0f71d1ab..9a46ca43a39b71426d5cd4d2023b26f577243b29 100644 --- a/api/glue/sdb.c +++ b/api/glue/sdb.c @@ -62,16 +62,16 @@ static eb_data_t eb_sdb_interconnect(eb_width_t width, eb_address_t addr, int de interconnect.sdb_version = 1; interconnect.sdb_bus_type = sdb_wishbone; - interconnect.component.begin = htobe64(0); - interconnect.component.end = htobe64(~(eb_address_t)0); - - interconnect.component.product.vendor_id = htobe64(0x651); /* GSI */ - interconnect.component.product.device_id = htobe32(0x02398114); - interconnect.component.product.version = htobe32(EB_VERSION_SHORT); - interconnect.component.product.date = htobe32(EB_DATE_SHORT); - interconnect.component.product.record_type = sdb_interconnect; + interconnect.sdb_component.addr_first = htobe64(0); + interconnect.sdb_component.addr_last = htobe64(~(eb_address_t)0); + + interconnect.sdb_component.product.vendor_id = htobe64(0x651); /* GSI */ + interconnect.sdb_component.product.device_id = htobe32(0x02398114); + interconnect.sdb_component.product.version = htobe32(EB_VERSION_SHORT); + interconnect.sdb_component.product.date = htobe32(EB_DATE_SHORT); + interconnect.sdb_component.product.record_type = sdb_interconnect; - memcpy(&interconnect.component.product.name[0], "Software-EB-Bus ", sizeof(interconnect.component.product.name)); + memcpy(&interconnect.sdb_component.product.name[0], "Software-EB-Bus ", sizeof(interconnect.sdb_component.product.name)); /* Extract the value needed */ out = eb_sdb_extract(&interconnect, width, addr); @@ -87,16 +87,16 @@ static eb_data_t eb_sdb_device(sdb_device_t device, eb_width_t width, eb_address dev.abi_ver_minor = device->abi_ver_minor; dev.bus_specific = htobe32(device->bus_specific); - dev.component.begin = htobe64(device->component.begin); - dev.component.end = htobe64(device->component.end); + dev.sdb_component.addr_first = htobe64(device->sdb_component.addr_first); + dev.sdb_component.addr_last = htobe64(device->sdb_component.addr_last); - dev.component.product.vendor_id = htobe64(device->component.product.vendor_id); - dev.component.product.device_id = htobe32(device->component.product.device_id); - dev.component.product.version = htobe32(device->component.product.version); - dev.component.product.date = htobe32(device->component.product.date); - dev.component.product.record_type = sdb_device; + dev.sdb_component.product.vendor_id = htobe64(device->sdb_component.product.vendor_id); + dev.sdb_component.product.device_id = htobe32(device->sdb_component.product.device_id); + dev.sdb_component.product.version = htobe32(device->sdb_component.product.version); + dev.sdb_component.product.date = htobe32(device->sdb_component.product.date); + dev.sdb_component.product.record_type = sdb_device; - memcpy(&dev.component.product.name[0], &device->component.product.name[0], sizeof(dev.component.product.name)); + memcpy(&dev.sdb_component.product.name[0], &device->sdb_component.product.name[0], sizeof(dev.sdb_component.product.name)); return eb_sdb_extract(&dev, width, addr); } @@ -162,8 +162,8 @@ static void eb_sdb_product_decode(struct sdb_product* product) { } static void eb_sdb_component_decode(struct sdb_component* component, eb_address_t bus_base) { - component->begin = be64toh(component->begin) + bus_base; - component->end = be64toh(component->end) + bus_base; + component->addr_first = be64toh(component->addr_first) + bus_base; + component->addr_last = be64toh(component->addr_last) + bus_base; eb_sdb_product_decode(&component->product); } @@ -188,7 +188,7 @@ static void eb_sdb_decode(struct eb_sdb_scan* scan, eb_device_t device, uint8_t* /* Bus endian fixup */ sdb->interconnect.sdb_magic = be32toh(sdb->interconnect.sdb_magic); sdb->interconnect.sdb_records = be16toh(sdb->interconnect.sdb_records); - eb_sdb_component_decode(&sdb->interconnect.component, bus_base); + eb_sdb_component_decode(&sdb->interconnect.sdb_component, bus_base); if (sizeof(struct sdb_device) * sdb->interconnect.sdb_records > size) { (*cb)(data, device, 0, EB_FAIL); @@ -203,12 +203,12 @@ static void eb_sdb_decode(struct eb_sdb_scan* scan, eb_device_t device, uint8_t* case sdb_device: r->device.abi_class = be16toh(r->device.abi_class); r->device.bus_specific = be32toh(r->device.bus_specific); - eb_sdb_component_decode(&r->device.component, bus_base); + eb_sdb_component_decode(&r->device.sdb_component, bus_base); break; case sdb_bridge: r->bridge.sdb_child = be64toh(r->bridge.sdb_child) + bus_base; - eb_sdb_component_decode(&r->bridge.component, bus_base); + eb_sdb_component_decode(&r->bridge.sdb_component, bus_base); break; case sdb_integration: @@ -355,7 +355,7 @@ eb_status_t eb_sdb_scan_bus(eb_device_t device, sdb_bridge_t bridge, eb_user_dat eb_address_t header_address; eb_address_t header_end; - if (bridge->component.product.record_type != sdb_bridge) + if (bridge->sdb_component.product.record_type != sdb_bridge) return EB_ADDRESS; if ((scanp = eb_new_sdb_scan()) == EB_NULL) @@ -364,7 +364,7 @@ eb_status_t eb_sdb_scan_bus(eb_device_t device, sdb_bridge_t bridge, eb_user_dat scan = EB_SDB_SCAN(scanp); scan->cb = cb; scan->user_data = data; - scan->bus_base = bridge->component.begin; + scan->bus_base = bridge->sdb_component.addr_first; stride = (eb_device_width(device) & EB_DATAX); diff --git a/api/test/loopback.cpp b/api/test/loopback.cpp index 4a0236d5474657c044d50151aaf07810d8d702a1..3ee4eb91625d631c8c18b9523d88b5e69e68783a 100644 --- a/api/test/loopback.cpp +++ b/api/test/loopback.cpp @@ -368,15 +368,15 @@ int main() { device.abi_ver_minor = 0; device.bus_specific = EB_DATAX; /* Support all access widths */ - device.component.begin = 0x4000; - device.component.end = ~(eb_address_t)0; - device.component.product.vendor_id = 0x651; /* GSI */ - device.component.product.device_id = 0xb576c7f1; - device.component.product.version = EB_VERSION_SHORT; - device.component.product.date = EB_DATE_SHORT; - device.component.product.record_type = sdb_device; - - memcpy(device.component.product.name, "Software-Memory ", sizeof(device.component.product.name)); + device.sdb_component.addr_first = 0x4000; + device.sdb_component.addr_last = ~(eb_address_t)0; + device.sdb_component.product.vendor_id = 0x651; /* GSI */ + device.sdb_component.product.device_id = 0xb576c7f1; + device.sdb_component.product.version = EB_VERSION_SHORT; + device.sdb_component.product.date = EB_DATE_SHORT; + device.sdb_component.product.record_type = sdb_device; + + memcpy(device.sdb_component.product.name, "Software-Memory ", sizeof(device.sdb_component.product.name)); Socket socket; if ((err = socket.open("60368", EB_DATA16|EB_ADDR32)) != EB_OK) die("socket.open", err); diff --git a/api/tools/common.c b/api/tools/common.c index c36fd023d2f07f6a6d123ea7c7aee19a0f40cee6..e3b608c279fffb3125f1d4eaf448384a36307da0 100644 --- a/api/tools/common.c +++ b/api/tools/common.c @@ -99,12 +99,12 @@ void find_device(eb_user_data_t data, eb_device_t dev, sdb_t sdb, eb_status_t st des = &sdb->record[i]; if (des->empty.record_type == sdb_bridge && - des->bridge.component.begin <= address && address <= des->bridge.component.end) { + des->bridge.sdb_component.addr_first <= address && address <= des->bridge.sdb_component.addr_last) { if (verbose) { fprintf(stdout, " discovered bridge ("); - fwrite(des->bridge.component.product.name, 1, sizeof(des->bridge.component.product.name), stdout); - fprintf(stdout, ") at 0x%"EB_ADDR_FMT" -- exploring...\n", (eb_address_t)des->bridge.component.begin); + fwrite(des->bridge.sdb_component.product.name, 1, sizeof(des->bridge.sdb_component.product.name), stdout); + fprintf(stdout, ") at 0x%"EB_ADDR_FMT" -- exploring...\n", (eb_address_t)des->bridge.sdb_component.addr_first); } eb_sdb_scan_bus(dev, &des->bridge, data, &find_device); @@ -112,7 +112,7 @@ void find_device(eb_user_data_t data, eb_device_t dev, sdb_t sdb, eb_status_t st } if (des->empty.record_type == sdb_device && - des->device.component.begin <= address && address <= des->device.component.end) { + des->device.sdb_component.addr_first <= address && address <= des->device.sdb_component.addr_last) { if ((des->device.bus_specific & SDB_WISHBONE_LITTLE_ENDIAN) != 0) @@ -124,9 +124,9 @@ void find_device(eb_user_data_t data, eb_device_t dev, sdb_t sdb, eb_status_t st if (verbose) { fprintf(stdout, " discovered ("); - fwrite(des->device.component.product.name, 1, sizeof(des->device.component.product.name), stdout); + fwrite(des->device.sdb_component.product.name, 1, sizeof(des->device.sdb_component.product.name), stdout); fprintf(stdout, ") at 0x%"EB_ADDR_FMT" with %s-bit %s\n", - (eb_address_t)des->device.component.begin, width_str[size], endian_str[dev_endian >> 4]); + (eb_address_t)des->device.sdb_component.addr_first, width_str[size], endian_str[dev_endian >> 4]); } *device_support = dev_endian | size; diff --git a/api/tools/eb-ls.c b/api/tools/eb-ls.c index ab84db44f630b2077f34e3af9d37e3467aa3c01d..6b4b2a1a340e8cf09e629a8285f4b861228a0d0a 100644 --- a/api/tools/eb-ls.c +++ b/api/tools/eb-ls.c @@ -54,7 +54,7 @@ static void help(void) { struct bus_record { int i; int stop; - eb_address_t begin, end; + eb_address_t addr_first, addr_last; struct bus_record* parent; }; @@ -70,27 +70,27 @@ static int print_id(struct bus_record* br) { } static void verbose_product(struct sdb_product* product) { - fprintf(stdout, " product.vendor_id: %016"PRIx64"\n", product->vendor_id); - fprintf(stdout, " product.device_id: %08"PRIx32"\n", product->device_id); - fprintf(stdout, " product.version: %08"PRIx32"\n", product->version); - fprintf(stdout, " product.date: %08"PRIx32"\n", product->date); - fprintf(stdout, " product.name: "); fwrite(&product->name[0], 1, sizeof(product->name), stdout); fprintf(stdout, "\n"); + fprintf(stdout, " product.vendor_id: %016"PRIx64"\n", product->vendor_id); + fprintf(stdout, " product.device_id: %08"PRIx32"\n", product->device_id); + fprintf(stdout, " product.version: %08"PRIx32"\n", product->version); + fprintf(stdout, " product.date: %08"PRIx32"\n", product->date); + fprintf(stdout, " product.name: "); fwrite(&product->name[0], 1, sizeof(product->name), stdout); fprintf(stdout, "\n"); fprintf(stdout, "\n"); } static void verbose_component(struct sdb_component* component, struct bus_record* br) { - fprintf(stdout, " component.begin: %016"PRIx64, component->begin); - if (component->begin < br->parent->begin || component->begin > br->parent->end) { + fprintf(stdout, " sdb_component.addr_first: %016"PRIx64, component->addr_first); + if (component->addr_first < br->parent->addr_first || component->addr_first > br->parent->addr_last) { fprintf(stdout, " !!! out of range\n"); } else { fprintf(stdout, "\n"); } - fprintf(stdout, " component.end: %016"PRIx64, component->end); - if (component->end < br->parent->begin || component->end > br->parent->end) { + fprintf(stdout, " sdb_component.addr_last: %016"PRIx64, component->addr_last); + if (component->addr_last < br->parent->addr_first || component->addr_last > br->parent->addr_last) { fprintf(stdout, " !!! out of range\n"); - } else if (component->end < component->begin) { - fprintf(stdout, " !!! precedes begin\n"); + } else if (component->addr_last < component->addr_first) { + fprintf(stdout, " !!! precedes addr_first\n"); } else { fprintf(stdout, "\n"); } @@ -113,15 +113,15 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdb_t sdb, eb_sta if (verbose) { fprintf(stdout, "SDB Bus "); print_id(br.parent); fprintf(stdout, "\n"); - fprintf(stdout, " sdb_magic: %08"PRIx32"\n", sdb->interconnect.sdb_magic); - fprintf(stdout, " sdb_records: %d\n", sdb->interconnect.sdb_records); - fprintf(stdout, " sdb_version: %d\n", sdb->interconnect.sdb_version); - verbose_component(&sdb->interconnect.component, &br); + fprintf(stdout, " sdb_magic: %08"PRIx32"\n", sdb->interconnect.sdb_magic); + fprintf(stdout, " sdb_records: %d\n", sdb->interconnect.sdb_records); + fprintf(stdout, " sdb_version: %d\n", sdb->interconnect.sdb_version); + verbose_component(&sdb->interconnect.sdb_component, &br); - if (sdb->interconnect.component.begin > br.parent->begin) - br.parent->begin = sdb->interconnect.component.begin; - if (sdb->interconnect.component.end < br.parent->end) - br.parent->end = sdb->interconnect.component.end; + if (sdb->interconnect.sdb_component.addr_first > br.parent->addr_first) + br.parent->addr_first = sdb->interconnect.sdb_component.addr_first; + if (sdb->interconnect.sdb_component.addr_last < br.parent->addr_last) + br.parent->addr_last = sdb->interconnect.sdb_component.addr_last; } devices = sdb->interconnect.sdb_records - 1; @@ -140,32 +140,32 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdb_t sdb, eb_sta case sdb_device: fprintf(stdout, "\n"); - fprintf(stdout, " abi_class: %04"PRIx16"\n", des->device.abi_class); - fprintf(stdout, " abi_ver_major: %d\n", des->device.abi_ver_major); - fprintf(stdout, " abi_ver_minor: %d\n", des->device.abi_ver_minor); - fprintf(stdout, " wbd_endian: %s\n", (des->device.bus_specific & SDB_WISHBONE_LITTLE_ENDIAN) ? "little" : "big"); - fprintf(stdout, " wbd_width: %"PRIx8"\n", des->device.bus_specific & SDB_WISHBONE_WIDTH); + fprintf(stdout, " abi_class: %04"PRIx16"\n", des->device.abi_class); + fprintf(stdout, " abi_ver_major: %d\n", des->device.abi_ver_major); + fprintf(stdout, " abi_ver_minor: %d\n", des->device.abi_ver_minor); + fprintf(stdout, " wbd_endian: %s\n", (des->device.bus_specific & SDB_WISHBONE_LITTLE_ENDIAN) ? "little" : "big"); + fprintf(stdout, " wbd_width: %"PRIx8"\n", des->device.bus_specific & SDB_WISHBONE_WIDTH); - verbose_component(&des->device.component, &br); + verbose_component(&des->device.sdb_component, &br); bad = 0; break; case sdb_bridge: fprintf(stdout, "\n"); - fprintf(stdout, " sdb_child: %016"PRIx64, des->bridge.sdb_child); - if (des->bridge.sdb_child < des->bridge.component.begin || des->bridge.sdb_child > des->bridge.component.end-64) { - fprintf(stdout, " !!! not contained in wbd_{begin,end}\n"); + fprintf(stdout, " sdb_child: %016"PRIx64, des->bridge.sdb_child); + if (des->bridge.sdb_child < des->bridge.sdb_component.addr_first || des->bridge.sdb_child > des->bridge.sdb_component.addr_last-64) { + fprintf(stdout, " !!! not contained in wbd_{addr_first,addr_last}\n"); } else { fprintf(stdout, "\n"); } - verbose_component(&des->bridge.component, &br); - bad = des->bridge.component.begin < br.parent->begin || - des->bridge.component.end > br.parent->end || - des->bridge.component.begin > des->bridge.component.end || - des->bridge.sdb_child < des->bridge.component.begin || - des->bridge.sdb_child > des->bridge.component.end-64; + verbose_component(&des->bridge.sdb_component, &br); + bad = des->bridge.sdb_component.addr_first < br.parent->addr_first || + des->bridge.sdb_component.addr_last > br.parent->addr_last || + des->bridge.sdb_component.addr_first > des->bridge.sdb_component.addr_last || + des->bridge.sdb_child < des->bridge.sdb_component.addr_first || + des->bridge.sdb_child > des->bridge.sdb_component.addr_last-64; break; @@ -184,19 +184,19 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdb_t sdb, eb_sta switch (des->empty.record_type) { case sdb_bridge: fprintf(stdout, "%016"PRIx64":%08"PRIx32" %16"EB_ADDR_FMT" ", - des->device.component.product.vendor_id, - des->device.component.product.device_id, - (eb_address_t)des->device.component.begin); - fwrite(des->device.component.product.name, 1, sizeof(des->device.component.product.name), stdout); + des->device.sdb_component.product.vendor_id, + des->device.sdb_component.product.device_id, + (eb_address_t)des->device.sdb_component.addr_first); + fwrite(des->device.sdb_component.product.name, 1, sizeof(des->device.sdb_component.product.name), stdout); fprintf(stdout, "\n"); break; case sdb_device: fprintf(stdout, "%016"PRIx64":%08"PRIx32" %16"EB_ADDR_FMT" ", - des->device.component.product.vendor_id, - des->device.component.product.device_id, - (eb_address_t)des->device.component.begin); - fwrite(des->device.component.product.name, 1, sizeof(des->device.component.product.name), stdout); + des->device.sdb_component.product.vendor_id, + des->device.sdb_component.product.device_id, + (eb_address_t)des->device.sdb_component.addr_first); + fwrite(des->device.sdb_component.product.name, 1, sizeof(des->device.sdb_component.product.name), stdout); fprintf(stdout, "\n"); break; @@ -210,8 +210,8 @@ static void list_devices(eb_user_data_t user, eb_device_t dev, sdb_t sdb, eb_sta if (!norecurse && !bad && des->empty.record_type == sdb_bridge) { br.stop = 0; - br.begin = des->bridge.component.begin; - br.end = des->bridge.component.end; + br.addr_first = des->bridge.sdb_component.addr_first; + br.addr_last = des->bridge.sdb_component.addr_last; eb_sdb_scan_bus(dev, &des->bridge, &br, &list_devices); while (!br.stop) eb_socket_run(eb_device_socket(dev), -1); @@ -236,8 +236,8 @@ int main(int argc, char** argv) { br.parent = 0; br.i = -1; br.stop = 0; - br.begin = 0; - br.end = ~(eb_address_t)0; + br.addr_first = 0; + br.addr_last = ~(eb_address_t)0; /* Default command-line arguments */ program = argv[0]; @@ -318,7 +318,7 @@ int main(int argc, char** argv) { } /* Find the limit of the bus space based on the address width */ - br.end >>= (sizeof(eb_address_t) - (eb_device_width(device) >> 4))*8; + br.addr_last >>= (sizeof(eb_address_t) - (eb_device_width(device) >> 4))*8; if ((status = eb_sdb_scan_root(device, &br, &list_devices)) != EB_OK) { fprintf(stderr, "%s: failed to scan remote device: %s\n", program, eb_status(status)); diff --git a/api/tools/eb-snoop.c b/api/tools/eb-snoop.c index b86f0399832f1e07882f723ff2ebaa3d1fb9a1b8..1fecb4adac543009c657b6b13ebfe1800b4f565e 100644 --- a/api/tools/eb-snoop.c +++ b/api/tools/eb-snoop.c @@ -193,14 +193,14 @@ int main(int argc, char** argv) { port = argv[optind]; - address = device.component.begin = strtoull(argv[optind+1], &value_end, 0); + address = device.sdb_component.addr_first = strtoull(argv[optind+1], &value_end, 0); if (*value_end != '-') { fprintf(stderr, "%s: wrong address-range format <begin>-<end> -- '%s'\n", program, argv[optind+1]); return 1; } - device.component.end = strtoull(value_end+1, &value_end, 0); + device.sdb_component.addr_last = strtoull(value_end+1, &value_end, 0); if (*value_end != 0) { fprintf(stderr, "%s: wrong address-range format <begin>-<end> -- '%s'\n", program, argv[optind+1]); @@ -213,22 +213,22 @@ int main(int argc, char** argv) { device.abi_ver_minor = 0; device.abi_class = 0x1; - device.component.product.vendor_id = 0x651; /* GSI */ - device.component.product.device_id = 0xc3c5eefa; - device.component.product.version = EB_VERSION_SHORT; - device.component.product.date = EB_DATE_SHORT; - device.component.product.record_type = sdb_device; + device.sdb_component.product.vendor_id = 0x651; /* GSI */ + device.sdb_component.product.device_id = 0xc3c5eefa; + device.sdb_component.product.version = EB_VERSION_SHORT; + device.sdb_component.product.date = EB_DATE_SHORT; + device.sdb_component.product.record_type = sdb_device; - memcpy(device.component.product.name, "Software-Memory ", sizeof(device.component.product.name)); + memcpy(device.sdb_component.product.name, "Software-Memory ", sizeof(device.sdb_component.product.name)); handler.device = &device; handler.data = 0; handler.read = &my_read; handler.write = &my_write; - if ((my_memory = calloc((device.component.end-device.component.begin)+1, 1)) == 0) { + if ((my_memory = calloc((device.sdb_component.addr_last-device.sdb_component.addr_first)+1, 1)) == 0) { fprintf(stderr, "%s: insufficient memory for 0x%"EB_ADDR_FMT"-0x%"EB_ADDR_FMT"\n", - program, (eb_address_t)device.component.begin, (eb_address_t)device.component.end); + program, (eb_address_t)device.sdb_component.addr_first, (eb_address_t)device.sdb_component.addr_last); return 1; }