Fix all the inconsistent nve_os* function declarations and definitions

in nve(4).  The OS_API structure defined in os.h expects NV_API_CALL
attributes, effectively regparm(0), on its function pointers, but all
the functions were declared and defined without this attribute.

MFC after:	1 week
This commit is contained in:
dim 2012-11-10 16:02:12 +00:00
parent 4459d54c31
commit 236a248a4a

View File

@ -152,30 +152,30 @@ static int nve_miibus_writereg(device_t, int, int, int);
static void nve_dmamap_cb(void *, bus_dma_segment_t *, int, int); static void nve_dmamap_cb(void *, bus_dma_segment_t *, int, int);
static void nve_dmamap_tx_cb(void *, bus_dma_segment_t *, int, bus_size_t, int); static void nve_dmamap_tx_cb(void *, bus_dma_segment_t *, int, bus_size_t, int);
static NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK);
static NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK);
static NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX);
static NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX);
static NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32);
static NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32);
static NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *);
static NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID);
static NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32);
static NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8);
static NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32);
static NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *);
static NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID);
static NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID);
static NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32);
static NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID);
static NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8);
static PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID);
static NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32);
static NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *);
static NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID);
static NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID);
static PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID);
static device_method_t nve_methods[] = { static device_method_t nve_methods[] = {
/* Device interface */ /* Device interface */
@ -1342,7 +1342,7 @@ nve_watchdog(struct nve_softc *sc)
/* --- Start of NVOSAPI interface --- */ /* --- Start of NVOSAPI interface --- */
/* Allocate DMA enabled general use memory for API */ /* Allocate DMA enabled general use memory for API */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK mem) nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK mem)
{ {
struct nve_softc *sc; struct nve_softc *sc;
@ -1370,7 +1370,7 @@ nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK mem)
} }
/* Free allocated memory */ /* Free allocated memory */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem) nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem)
{ {
DEBUGOUT(NVE_DEBUG_API, "nve: nve_osfree - 0x%x - %d\n", DEBUGOUT(NVE_DEBUG_API, "nve: nve_osfree - 0x%x - %d\n",
@ -1381,7 +1381,7 @@ nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem)
} }
/* Copied directly from nvnet.c */ /* Copied directly from nvnet.c */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex)
{ {
MEMORY_BLOCK mem_block; MEMORY_BLOCK mem_block;
@ -1427,7 +1427,7 @@ nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex)
} }
/* Copied directly from nvnet.c */ /* Copied directly from nvnet.c */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex)
{ {
MEMORY_BLOCK mem_block; MEMORY_BLOCK mem_block;
@ -1442,7 +1442,7 @@ nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex)
} }
/* Clear memory region */ /* Clear memory region */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length) nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length)
{ {
DEBUGOUT(NVE_DEBUG_API, "nve: nve_osclear\n"); DEBUGOUT(NVE_DEBUG_API, "nve: nve_osclear\n");
@ -1451,7 +1451,7 @@ nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length)
} }
/* Sleep for a tick */ /* Sleep for a tick */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osdelay(PNV_VOID ctx, NV_UINT32 usec) nve_osdelay(PNV_VOID ctx, NV_UINT32 usec)
{ {
DELAY(usec); DELAY(usec);
@ -1459,7 +1459,7 @@ nve_osdelay(PNV_VOID ctx, NV_UINT32 usec)
} }
/* Allocate memory for rx buffer */ /* Allocate memory for rx buffer */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osallocrxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID *id) nve_osallocrxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID *id)
{ {
struct nve_softc *sc = ctx; struct nve_softc *sc = ctx;
@ -1515,7 +1515,7 @@ fail:
} }
/* Free the rx buffer */ /* Free the rx buffer */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id) nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id)
{ {
struct nve_softc *sc = ctx; struct nve_softc *sc = ctx;
@ -1539,7 +1539,7 @@ nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id)
} }
/* This gets called by the Nvidia API after our TX packet has been sent */ /* This gets called by the Nvidia API after our TX packet has been sent */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_ospackettx(PNV_VOID ctx, PNV_VOID id, NV_UINT32 success) nve_ospackettx(PNV_VOID ctx, PNV_VOID id, NV_UINT32 success)
{ {
struct nve_softc *sc = ctx; struct nve_softc *sc = ctx;
@ -1578,7 +1578,7 @@ fail:
/* This gets called by the Nvidia API when a new packet has been received */ /* This gets called by the Nvidia API when a new packet has been received */
/* XXX What is newbuf used for? XXX */ /* XXX What is newbuf used for? XXX */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_ospacketrx(PNV_VOID ctx, PNV_VOID data, NV_UINT32 success, NV_UINT8 *newbuf, nve_ospacketrx(PNV_VOID ctx, PNV_VOID data, NV_UINT32 success, NV_UINT8 *newbuf,
NV_UINT8 priority) NV_UINT8 priority)
{ {
@ -1636,7 +1636,7 @@ nve_ospacketrx(PNV_VOID ctx, PNV_VOID data, NV_UINT32 success, NV_UINT8 *newbuf,
} }
/* This gets called by NVIDIA API when the PHY link state changes */ /* This gets called by NVIDIA API when the PHY link state changes */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled) nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled)
{ {
@ -1646,7 +1646,7 @@ nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled)
} }
/* Setup a watchdog timer */ /* Setup a watchdog timer */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer) nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer)
{ {
struct nve_softc *sc = (struct nve_softc *)ctx; struct nve_softc *sc = (struct nve_softc *)ctx;
@ -1660,7 +1660,7 @@ nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer)
} }
/* Free the timer */ /* Free the timer */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer) nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer)
{ {
@ -1672,7 +1672,7 @@ nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer)
} }
/* Setup timer parameters */ /* Setup timer parameters */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osinittimer(PNV_VOID ctx, PNV_VOID timer, PTIMER_FUNC func, PNV_VOID parameters) nve_osinittimer(PNV_VOID ctx, PNV_VOID timer, PTIMER_FUNC func, PNV_VOID parameters)
{ {
struct nve_softc *sc = (struct nve_softc *)ctx; struct nve_softc *sc = (struct nve_softc *)ctx;
@ -1686,7 +1686,7 @@ nve_osinittimer(PNV_VOID ctx, PNV_VOID timer, PTIMER_FUNC func, PNV_VOID paramet
} }
/* Set the timer to go off */ /* Set the timer to go off */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_ossettimer(PNV_VOID ctx, PNV_VOID timer, NV_UINT32 delay) nve_ossettimer(PNV_VOID ctx, PNV_VOID timer, NV_UINT32 delay)
{ {
struct nve_softc *sc = ctx; struct nve_softc *sc = ctx;
@ -1700,7 +1700,7 @@ nve_ossettimer(PNV_VOID ctx, PNV_VOID timer, NV_UINT32 delay)
} }
/* Cancel the timer */ /* Cancel the timer */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer) nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer)
{ {
@ -1711,7 +1711,7 @@ nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer)
return (1); return (1);
} }
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id, nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id,
NV_UINT8 *newbuffer, NV_UINT8 priority) NV_UINT8 *newbuffer, NV_UINT8 priority)
{ {
@ -1722,7 +1722,7 @@ nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id,
return (1); return (1);
} }
static PNV_VOID static NV_API_CALL PNV_VOID
nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata) nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata)
{ {
@ -1732,7 +1732,7 @@ nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata)
return (NULL); return (NULL);
} }
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno) nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno)
{ {
@ -1743,7 +1743,7 @@ nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno)
} }
/* Allocate mutex context (already done in nve_attach) */ /* Allocate mutex context (already done in nve_attach) */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_oslockalloc(PNV_VOID ctx, NV_SINT32 type, PNV_VOID *pLock) nve_oslockalloc(PNV_VOID ctx, NV_SINT32 type, PNV_VOID *pLock)
{ {
struct nve_softc *sc = (struct nve_softc *)ctx; struct nve_softc *sc = (struct nve_softc *)ctx;
@ -1756,7 +1756,7 @@ nve_oslockalloc(PNV_VOID ctx, NV_SINT32 type, PNV_VOID *pLock)
} }
/* Obtain a spin lock */ /* Obtain a spin lock */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
{ {
@ -1766,7 +1766,7 @@ nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
} }
/* Release lock */ /* Release lock */
static NV_SINT32 static NV_API_CALL NV_SINT32
nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
{ {
@ -1776,7 +1776,7 @@ nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
} }
/* I have no idea what this is for */ /* I have no idea what this is for */
static PNV_VOID static NV_API_CALL PNV_VOID
nve_osreturnbufvirt(PNV_VOID ctx, PNV_VOID readdata) nve_osreturnbufvirt(PNV_VOID ctx, PNV_VOID readdata)
{ {