[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cdi-devel] [PATCH 2/2] cdi: Fix compilation on Linux
Most CDI drivers assume a strange libc like the tyndur one. This patch
cleans them up and allows to compile the drivers on Linux.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
ata/main.c | 1 +
ata/request.c | 1 +
e1000/device.c | 4 ++--
include/cdi.h | 1 -
iso9660/dir.c | 1 +
iso9660/init.c | 4 ++--
iso9660/sector.c | 1 +
ne2k/main.c | 1 +
ne2k/ne2k.c | 1 +
pcnet/pcnet.c | 4 ++--
ramdisk/file.c | 2 ++
ramdisk/init.c | 4 +++-
ramdisk/link.c | 2 ++
ramdisk/res.c | 2 ++
rtl8139/main.c | 1 +
rtl8139/rtl8139.c | 1 +
serial/init.c | 2 ++
serial/res.c | 2 ++
18 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/ata/main.c b/ata/main.c
index 144a6f8..d5200c2 100644
--- a/ata/main.c
+++ b/ata/main.c
@@ -29,6 +29,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "cdi/storage.h"
#include "cdi/lists.h"
diff --git a/ata/request.c b/ata/request.c
index 6724416..e98ee60 100644
--- a/ata/request.c
+++ b/ata/request.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "cdi.h"
#include "cdi/storage.h"
diff --git a/e1000/device.c b/e1000/device.c
index 48f3a58..dd37510 100644
--- a/e1000/device.c
+++ b/e1000/device.c
@@ -165,14 +165,14 @@ void e1000_init_device(struct cdi_device* device)
}
// Karte initialisieren
- printf("e1000: IRQ %d, MMIO an %x Revision:%d\n",
+ printf("e1000: IRQ %d, MMIO an %p Revision:%d\n",
netcard->pci->irq, netcard->mem_base, netcard->revision);
printf("e1000: Fuehre Reset der Karte durch\n");
reset_nic(netcard);
netcard->net.mac = get_mac_address(netcard);
- printf("e1000: MAC-Adresse: %012llx\n", netcard->net.mac);
+ printf("e1000: MAC-Adresse: %012llx\n", (uint64_t) netcard->net.mac);
cdi_net_device_init((struct cdi_net_device*) device);
}
diff --git a/include/cdi.h b/include/cdi.h
index 7bcf9e4..d803751 100644
--- a/include/cdi.h
+++ b/include/cdi.h
@@ -19,7 +19,6 @@
#include "cdi/lists.h"
#define CDI_STANDALONE
-#define TYNDUR
typedef enum {
CDI_UNKNOWN = 0,
diff --git a/iso9660/dir.c b/iso9660/dir.c
index 0aec9cd..b1cae4f 100644
--- a/iso9660/dir.c
+++ b/iso9660/dir.c
@@ -18,6 +18,7 @@
#include <stddef.h>
#include <stdlib.h>
+#include <string.h>
#include "cdi/fs.h"
#include "cdi/lists.h"
diff --git a/iso9660/init.c b/iso9660/init.c
index 868ed7c..641d4f3 100644
--- a/iso9660/init.c
+++ b/iso9660/init.c
@@ -31,7 +31,7 @@
* @return If initialization was successful
*/
int iso9660_fs_init(struct cdi_fs_filesystem *fs) {
- debug("iso9660_fs_init(0x%x)\n",fs);
+ debug("iso9660_fs_init(0x%p)\n",fs);
struct iso9660_voldesc_prim *voldesc = malloc(sizeof(struct iso9660_voldesc_prim));
if (iso9660_voldesc_load(fs,ISO9660_VOLDESC_PRIM,voldesc)!=-1) {
struct iso9660_fs_res *root_res = iso9660_dirrec_load(&voldesc->root_dir,NULL,voldesc);
@@ -48,7 +48,7 @@ int iso9660_fs_init(struct cdi_fs_filesystem *fs) {
* @return If destroy was successful
*/
int iso9660_fs_destroy(struct cdi_fs_filesystem *fs) {
- fprintf(stderr,"iso9660_fs_destroy(0x%x)\n",fs);
+ fprintf(stderr,"iso9660_fs_destroy(0x%p)\n",fs);
struct iso9660_fs_res *root_res = (struct iso9660_fs_res*)(fs->root_res);
free(root_res->voldesc);
cdi_cache_destroy(root_res->cache);
diff --git a/iso9660/sector.c b/iso9660/sector.c
index 48ffe82..645fb10 100644
--- a/iso9660/sector.c
+++ b/iso9660/sector.c
@@ -17,6 +17,7 @@
*/
#include <stdint.h>
+#include <string.h>
#include "cdi/fs.h"
#include "cdi/cache.h"
diff --git a/ne2k/main.c b/ne2k/main.c
index 7440ead..3a8a87e 100644
--- a/ne2k/main.c
+++ b/ne2k/main.c
@@ -27,6 +27,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include "cdi/net.h"
#include "cdi/pci.h"
diff --git a/ne2k/ne2k.c b/ne2k/ne2k.c
index 043592b..a77465b 100644
--- a/ne2k/ne2k.c
+++ b/ne2k/ne2k.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include "cdi/net.h"
#include "cdi/pci.h"
diff --git a/pcnet/pcnet.c b/pcnet/pcnet.c
index 130b29a..d9e54f9 100644
--- a/pcnet/pcnet.c
+++ b/pcnet/pcnet.c
@@ -242,7 +242,7 @@ void pcnet_dev_init(struct pcnet_device *netcard, int promiscuous)
}
#ifdef DEBUG
- printf("pcnet: descriptor region at 0x%x virtual and 0x%x physical\n", virt_desc_region, phys_desc_region);
+ printf("pcnet: descriptor region at 0x%p virtual and 0x%p physical\n", virt_desc_region, phys_desc_region);
#endif
netcard->receive_descriptor = virt_desc_region;
netcard->transmit_descriptor = virt_desc_region + 2 * 1024;
@@ -263,7 +263,7 @@ void pcnet_dev_init(struct pcnet_device *netcard, int promiscuous)
netcard->initialization_block->physical_address = netcard->net.mac;
#ifdef DEBUG
- printf("pcnet: initialization block at 0x%x virtual and 0x%x physical\n",
+ printf("pcnet: initialization block at 0x%p virtual and 0x%p physical\n",
netcard->initialization_block,
netcard->phys_initialization_block);
#endif
diff --git a/ramdisk/file.c b/ramdisk/file.c
index 4358c1e..2f8676c 100644
--- a/ramdisk/file.c
+++ b/ramdisk/file.c
@@ -26,6 +26,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include "ramdisk_cdi.h"
size_t ramdisk_fs_file_read(struct cdi_fs_stream* stream, uint64_t start,
diff --git a/ramdisk/init.c b/ramdisk/init.c
index dfe833e..04028c0 100644
--- a/ramdisk/init.c
+++ b/ramdisk/init.c
@@ -26,9 +26,11 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdio.h>
+#include <string.h>
+
#include "ramdisk_cdi.h"
#include "cdi/lists.h"
-#include <stdio.h>
int ramdisk_fs_init(struct cdi_fs_filesystem* cdi_fs)
{
diff --git a/ramdisk/link.c b/ramdisk/link.c
index f3681af..519c0fd 100644
--- a/ramdisk/link.c
+++ b/ramdisk/link.c
@@ -26,6 +26,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include "ramdisk_cdi.h"
const char *ramdisk_fs_link_read(struct cdi_fs_stream *stream)
diff --git a/ramdisk/res.c b/ramdisk/res.c
index 80874e3..0fab6d4 100644
--- a/ramdisk/res.c
+++ b/ramdisk/res.c
@@ -26,6 +26,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include "ramdisk_cdi.h"
int ramdisk_fs_res_load(struct cdi_fs_stream* stream)
diff --git a/rtl8139/main.c b/rtl8139/main.c
index b864724..07c1adf 100644
--- a/rtl8139/main.c
+++ b/rtl8139/main.c
@@ -27,6 +27,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include "cdi/net.h"
#include "cdi/pci.h"
diff --git a/rtl8139/rtl8139.c b/rtl8139/rtl8139.c
index ab38d93..7b43154 100644
--- a/rtl8139/rtl8139.c
+++ b/rtl8139/rtl8139.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include "cdi/net.h"
#include "cdi/pci.h"
diff --git a/serial/init.c b/serial/init.c
index db7959e..924a4c5 100644
--- a/serial/init.c
+++ b/serial/init.c
@@ -30,7 +30,9 @@
#include "serial.h"
#include "cdi/lists.h"
#include "cdi/misc.h"
+
#include <stdio.h>
+#include <string.h>
int serial_fs_init(struct cdi_fs_filesystem* cdi_fs)
{
diff --git a/serial/res.c b/serial/res.c
index 82a015a..ae32487 100644
--- a/serial/res.c
+++ b/serial/res.c
@@ -26,6 +26,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
#include "serial_cdi.h"
#include "serial.h"
--
1.6.0.2