Date: Sat, 17 Nov 2012 22:58:33 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243192 - stable/9/sys/dev/nve Message-ID: <201211172258.qAHMwXXu001286@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Nov 17 22:58:33 2012 New Revision: 243192 URL: http://svnweb.freebsd.org/changeset/base/243192 Log: MFC r242873: 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. Modified: stable/9/sys/dev/nve/if_nve.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nve/if_nve.c ============================================================================== --- stable/9/sys/dev/nve/if_nve.c Sat Nov 17 22:50:50 2012 (r243191) +++ stable/9/sys/dev/nve/if_nve.c Sat Nov 17 22:58:33 2012 (r243192) @@ -152,30 +152,30 @@ static int nve_miibus_writereg(devi 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 NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); -static NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); -static NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); -static 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_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); -static NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); -static 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_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); - -static 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_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); -static NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); -static NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); -static NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); -static PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); +static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); + +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); static device_method_t nve_methods[] = { /* Device interface */ @@ -1343,7 +1343,7 @@ nve_watchdog(struct nve_softc *sc) /* --- Start of NVOSAPI interface --- */ /* 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) { struct nve_softc *sc; @@ -1371,7 +1371,7 @@ nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK } /* Free allocated memory */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osfree - 0x%x - %d\n", @@ -1382,7 +1382,7 @@ nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK m } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1428,7 +1428,7 @@ nve_osallocex(PNV_VOID ctx, PMEMORY_BLOC } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1443,7 +1443,7 @@ nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCK } /* Clear memory region */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osclear\n"); @@ -1452,7 +1452,7 @@ nve_osclear(PNV_VOID ctx, PNV_VOID mem, } /* Sleep for a tick */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID ctx, NV_UINT32 usec) { DELAY(usec); @@ -1460,7 +1460,7 @@ nve_osdelay(PNV_VOID ctx, NV_UINT32 usec } /* 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) { struct nve_softc *sc = ctx; @@ -1516,7 +1516,7 @@ fail: } /* Free the rx buffer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id) { struct nve_softc *sc = ctx; @@ -1540,7 +1540,7 @@ nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BL } /* 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) { struct nve_softc *sc = ctx; @@ -1579,7 +1579,7 @@ fail: /* This gets called by the Nvidia API when a new packet has been received */ /* 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, NV_UINT8 priority) { @@ -1637,7 +1637,7 @@ nve_ospacketrx(PNV_VOID ctx, PNV_VOID da } /* 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) { @@ -1647,7 +1647,7 @@ nve_oslinkchg(PNV_VOID ctx, NV_SINT32 en } /* Setup a watchdog timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1661,7 +1661,7 @@ nve_osalloctimer(PNV_VOID ctx, PNV_VOID } /* Free the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1673,7 +1673,7 @@ nve_osfreetimer(PNV_VOID ctx, PNV_VOID t } /* 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) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1687,7 +1687,7 @@ nve_osinittimer(PNV_VOID ctx, PNV_VOID t } /* 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) { struct nve_softc *sc = ctx; @@ -1701,7 +1701,7 @@ nve_ossettimer(PNV_VOID ctx, PNV_VOID ti } /* Cancel the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1712,7 +1712,7 @@ nve_oscanceltimer(PNV_VOID ctx, PNV_VOID return (1); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id, NV_UINT8 *newbuffer, NV_UINT8 priority) { @@ -1723,7 +1723,7 @@ nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID return (1); } -static PNV_VOID +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata) { @@ -1733,7 +1733,7 @@ nve_ospreprocpktnopq(PNV_VOID ctx, PNV_V return (NULL); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno) { @@ -1744,7 +1744,7 @@ nve_osindicatepkt(PNV_VOID ctx, PNV_VOID } /* 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) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1757,7 +1757,7 @@ nve_oslockalloc(PNV_VOID ctx, NV_SINT32 } /* Obtain a spin lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1767,7 +1767,7 @@ nve_oslockacquire(PNV_VOID ctx, NV_SINT3 } /* Release lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1777,7 +1777,7 @@ nve_oslockrelease(PNV_VOID ctx, NV_SINT3 } /* 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211172258.qAHMwXXu001286>