fixup implicit function declaration warnings

This commit is contained in:
joe 2015-10-06 18:25:40 -07:00
parent 71635538ee
commit 2e616010c3
12 changed files with 37 additions and 16 deletions

View file

@ -36,6 +36,7 @@ ifeq ($(TARGET),linux)
INCLUDE = -I/usr/include
BIN = mesaflash
LIBS = -lpci $(MATHLIB)
CFLAGS += -D_GNU_SOURCE
endif
ifeq ($(TARGET),windows)
@ -46,7 +47,7 @@ ifeq ($(TARGET),windows)
DEBUG += -mno-ms-bitfields
endif
CFLAGS = $(OPT) $(DEBUG) $(INCLUDE)
CFLAGS += $(OPT) $(DEBUG) $(INCLUDE)
objects = common.o lbp.o lbp16.o bitfile.o hostmot2.o eeprom.o anyio.o eth_boards.o epp_boards.o usb_boards.o pci_boards.o
objects += sserial_module.o encoder_module.o eeprom_local.o eeprom_remote.o spi_boards.o serial_boards.o

View file

@ -27,6 +27,7 @@
#include "epp_boards.h"
#include "usb_boards.h"
#include "spi_boards.h"
#include "serial_boards.h"
supported_board_entry_t supported_boards[] = {
{"7I92", BOARD_ETH},

View file

@ -24,6 +24,8 @@
#endif
#include "hostmot2.h"
#include "eeprom.h"
#define MAX_BOARDS 8
#define BOARD_ANY (0)

View file

@ -20,6 +20,7 @@
#define __EEPROM_H
#include "hostmot2.h"
#include "bitfile.h"
#define ID_EEPROM_1M 0x10
#define ID_EEPROM_2M 0x11

View file

@ -18,6 +18,10 @@
#ifdef __linux__
#include <sys/io.h>
#include <pci/pci.h>
#elif _WIN32
#include <windows.h>
#include "libpci/pci.h"
#endif
#include <sys/stat.h>
#include <stdio.h>

View file

@ -30,6 +30,8 @@
#include "libpci/pci.h"
#endif
extern int usleep(useconds_t usec); // static global access variable conflicts with POSIX function in unistd.h
static int device_flag;
static int instance_flag;
static int instance = 0;

View file

@ -30,6 +30,8 @@
#include "libpci/pci.h"
#endif
extern int usleep(useconds_t usec); // static global access variable conflicts with POSIX function in unistd.h
static int device_flag;
static int instance_flag;
static int instance = 0;

View file

@ -87,6 +87,8 @@ void hm2_print_idrom(hostmot2_t *hm2);
void hm2_print_modules(hostmot2_t *hm2);
void hm2_print_pins(hostmot2_t *hm2);
void hm2_print_pin_file(llio_t *llio, int xml_flag);
void hm2_set_pin_source(hostmot2_t *hm2, int pin_number, u8 source);
void hm2_set_pin_direction(hostmot2_t *hm2, int pin_number, u8 direction);
void sserial_module_init(llio_t *llio);
#endif

View file

@ -25,6 +25,7 @@
#include "libpci/pci.h"
#endif
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
@ -691,6 +692,21 @@ static int plx905x_reset(llio_t *self) {
return 0;
}
int pci_read(llio_t *self, u32 addr, void *buffer, int size) {
board_t *board = self->board;
memcpy(buffer, (board->base + addr), size);
// printf("READ %X, (%X + %X), %d\n", buffer, board->base, addr, size);
return 0;
}
int pci_write(llio_t *self, u32 addr, void *buffer, int size) {
board_t *board = self->board;
memcpy((board->base + addr), buffer, size);
return 0;
}
static int pci_board_reload(llio_t *self, int fallback_flag) {
board_t *board = self->board;
int i;
@ -766,21 +782,6 @@ static void pci_fix_bar_lengths(struct pci_dev *dev) {
#endif
}
int pci_read(llio_t *self, u32 addr, void *buffer, int size) {
board_t *board = self->board;
memcpy(buffer, (board->base + addr), size);
// printf("READ %X, (%X + %X), %d\n", buffer, board->base, addr, size);
return 0;
}
int pci_write(llio_t *self, u32 addr, void *buffer, int size) {
board_t *board = self->board;
memcpy((board->base + addr), buffer, size);
return 0;
}
static int pci_board_open(board_t *board) {
if (board->mem_base != 0) {
#ifdef __linux__

View file

@ -17,6 +17,8 @@
//
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>

View file

@ -21,6 +21,8 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>

View file

@ -54,5 +54,6 @@ typedef struct {
int sserial_init(sserial_module_t *ssmod, board_t *board, int interface_num, int channel_num, u32 remote_type);
int sserial_cleanup(sserial_module_t *ssmod);
void sserial_module_init(llio_t *llio);
int sserial_write(sserial_module_t *ssmod);
#endif