Index: branches/2020Q3/sysutils/rovclock/Makefile =================================================================== --- branches/2020Q3/sysutils/rovclock/Makefile (revision 542896) +++ branches/2020Q3/sysutils/rovclock/Makefile (revision 542897) @@ -1,40 +1,33 @@ # Created by: Alexey Dokuchaev # $FreeBSD$ PORTNAME= rovclock PORTVERSION= 0.6e CATEGORIES= sysutils MASTER_SITES= http://www.hasw.net/linux/ MAINTAINER= danfe@FreeBSD.org COMMENT= Overclocking utility for ATI Radeon video cards LICENSE= GPLv2 -BROKEN_aarch64= fails to install: undefined reference to outl -BROKEN_armv6= fails to install: undefined reference to outl -BROKEN_armv7= fails to install: undefined reference to outl -BROKEN_mips= fails to install: undefined reference to outl -BROKEN_mips64= fails to install: undefined reference to outl -BROKEN_powerpc64= fails to install: undefined reference to outl - USES= tar:bzip2 PLIST_FILES= man/man8/${PORTNAME}.8.gz sbin/${PORTNAME} PORTDOCS= ChangeLog README OPTIONS_DEFINE= DOCS do-build: cd ${WRKSRC} && ${CC} ${CFLAGS} -Wall -o ${PORTNAME} ${PORTNAME}.c do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${FILESDIR}/${PORTNAME}.8 \ ${STAGEDIR}${MANPREFIX}/man/man8 post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} .include Index: branches/2020Q3/sysutils/rovclock/files/patch-rovclock.c =================================================================== --- branches/2020Q3/sysutils/rovclock/files/patch-rovclock.c (revision 542896) +++ branches/2020Q3/sysutils/rovclock/files/patch-rovclock.c (revision 542897) @@ -1,122 +1,125 @@ --- rovclock.c.orig 2006-01-04 21:23:32 UTC +++ rovclock.c -@@ -20,11 +20,13 @@ +@@ -20,11 +20,16 @@ */ /*****************************************************************************/ +#include #include #include #include #include -#include +#include ++#if !defined(__amd64__) && !defined(__i386__) ++#include ++#endif +#include #include #include "pci.h" -@@ -122,18 +124,18 @@ struct rovclock_data { +@@ -122,18 +127,18 @@ struct rovclock_data { /* PCI read/write functions */ unsigned int pci_read(u8 bus, u8 device, u8 func, u8 addr) { - outl(0x80000000 | (bus << 16) | + outl(0xcf8, 0x80000000 | (bus << 16) | (PCI_DEVFN(device, func) << 8) | - (addr & ~3), 0xcf8); + (addr & ~3)); return inl(0xcfc); } void pci_write(u8 bus, u8 device, u8 func, u8 addr, u32 data) { - outl(0x80000000 | (bus << 16) | + outl(0xcf8, 0x80000000 | (bus << 16) | (PCI_DEVFN(device, func) << 8) | - (addr & ~3), 0xcf8); - outl(data, 0xcfc); + (addr & ~3)); + outl(0xcfc, data); } /* Register read/write functions */ -@@ -144,38 +146,38 @@ u32 reg_read(struct rovclock_data *rovcl +@@ -144,38 +149,38 @@ u32 reg_read(struct rovclock_data *rovclock, u32 addr) void reg_write(struct rovclock_data *rovclock, u32 addr, u32 data) { - outl(data, rovclock->iobase + addr); + outl(rovclock->iobase + addr, data); } /* PLL read/write functions */ u32 pll_read(struct rovclock_data *rovclock, u32 addr) { - outb(addr & 0x0000003f, rovclock->iobase + CLOCK_CNTL_INDEX); + outb(rovclock->iobase + CLOCK_CNTL_INDEX, addr & 0x0000003f); return inl(rovclock->iobase + CLOCK_CNTL_DATA); } void pll_write(struct rovclock_data *rovclock, u32 addr, u32 data) { - outb((addr & 0x3f) | PLL_WR_EN, rovclock->iobase + CLOCK_CNTL_INDEX); - outl(data, rovclock->iobase + CLOCK_CNTL_DATA); + outb(rovclock->iobase + CLOCK_CNTL_INDEX, (addr & 0x3f) | PLL_WR_EN); + outl(rovclock->iobase + CLOCK_CNTL_DATA, data); } /* MM read/write functions */ u32 mm_read(struct rovclock_data *rovclock, u32 addr) { - outl(addr, rovclock->iobase + MM_INDEX); + outl(rovclock->iobase + MM_INDEX, addr); return inl(rovclock->iobase + MM_DATA); } void mm_write(struct rovclock_data *rovclock, u32 addr, u32 data) { - outl(addr, rovclock->iobase + MM_INDEX); - outl(data, rovclock->iobase + MM_DATA); + outl(rovclock->iobase + MM_INDEX, addr); + outl(rovclock->iobase + MM_DATA, data); } int round_div(int num, int den) { - return (num + (den / 2)) / den; + return den ? (num + (den / 2)) / den : 0; } /* Print usage */ -@@ -281,10 +283,11 @@ void pll_set_freq(struct rovclock_data * +@@ -281,10 +286,11 @@ void pll_set_freq(struct rovclock_data *rovclock) /* Search for ATI card on PCI bus */ int find_card(struct rovclock_data *rovclock) { + u32 id; +#if 0 FILE *proc; char temp; - u32 id; - + /* Check /proc/bus/pci/devices first */ if ((proc = fopen("/proc/bus/pci/devices", "r")) != NULL) { while (fscanf(proc, "%x\t%x", &rovclock->pci_bus, &id) == 2) { -@@ -305,8 +308,9 @@ int find_card(struct rovclock_data *rovc +@@ -305,8 +311,9 @@ int find_card(struct rovclock_data *rovclock) break; } } +#endif if ((rovclock->pci_id & 0xffff) != PCI_VENDOR_ID_ATI) { - fprintf(stderr, "Search in /proc/bus/pci/devices failed, scanning the PCI bus.\n"); + fprintf(stderr, "Scanning the PCI bus.\n"); /* Find card by scanning the PCI devices, check from bus 1 to 9 for ATI device */ rovclock->pci_dev = 0; -@@ -423,7 +427,7 @@ int main(int argc, char **argv) +@@ -423,7 +430,7 @@ int main(int argc, char **argv) } /* Get I/O permission */ - if (iopl(3) != 0) { + if (open("/dev/io", O_RDONLY) < 0) { fprintf(stderr, "Error getting I/O permissions (root?).\n"); return 1; } Index: branches/2020Q3 =================================================================== --- branches/2020Q3 (revision 542896) +++ branches/2020Q3 (revision 542897) Property changes on: branches/2020Q3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r542896