summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2002-10-24 03:33:07 +0000
committerKris Kennaway <kris@FreeBSD.org>2002-10-24 03:33:07 +0000
commit57199ac13084b2994880bda502656d31532aceab (patch)
tree8f52e1ffe0f661c09d9f63e837f59c9236be28dc /sysutils
parentPartially fix build on -current by correcting incorrect patch (diff)
Remove #include <malloc.h>. Build still broken.
Notes
Notes: svn path=/head/; revision=68701
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/sjog/files/patch-setbrightness::setbrightness.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/sysutils/sjog/files/patch-setbrightness::setbrightness.c b/sysutils/sjog/files/patch-setbrightness::setbrightness.c
index c1a8962fd0e4..05ece8e0d580 100644
--- a/sysutils/sjog/files/patch-setbrightness::setbrightness.c
+++ b/sysutils/sjog/files/patch-setbrightness::setbrightness.c
@@ -1,86 +1,86 @@
---- setbrightness/setbrightness.c.orig Sat Jul 28 18:16:22 2001
-+++ setbrightness/setbrightness.c Sat Aug 17 20:38:56 2002
-@@ -1,44 +1,58 @@
-+/* FreeBSD modifications by Jay Kuri jk@oneway.com 08/13/01 */
-+
+--- setbrightness/setbrightness.c Wed Oct 23 20:32:07 2002
++++ setbrightness/setbrightness.c.orig Sat Jul 28 10:16:22 2001
+@@ -1,57 +1,44 @@
+-/* FreeBSD modifications by Jay Kuri jk@oneway.com 08/13/01 */
+-
#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-+#ifndef __FreeBSD__
+-#ifndef __FreeBSD__
#include <sys/io.h>
-+#endif
+-#endif
#include <sys/mman.h>
#include <dirent.h>
#include <ctype.h>
- #include <malloc.h>
++#include <malloc.h>
#include <string.h>
#include <signal.h>
-+#ifndef __FreeBSD__
+-#ifndef __FreeBSD__
#include <getopt.h>
#include <linux/pci.h>
-+#endif
+-#endif
#include <sys/time.h>
-+#ifdef __FreeBSD__
-+#include <machine/cpufunc.h>
-+#include "../src/sonypi.h"
-+#endif
+-#ifdef __FreeBSD__
+-#include <machine/cpufunc.h>
+-#include "../src/sonypi.h"
+-#endif
#define BRIGHTNESS 0x96
#define DATA_REG 0x62
#define CST_REG 0x66
-+#ifndef __FreeBSD__
+-#ifndef __FreeBSD__
typedef unsigned short u16;
-+#define OUTW outw
-+#define OUTB outb
-+#endif
+-#define OUTW outw
+-#define OUTB outb
+-#endif
static void ecr_set(u16 value)
{
while (inw(CST_REG) & 3) usleep(1);
-- outw(0x81, CST_REG);
-+ OUTW(0x81, CST_REG);
+- OUTW(0x81, CST_REG);
++ outw(0x81, CST_REG);
while (inw(CST_REG) & 2) usleep(1);
-- outw(BRIGHTNESS, DATA_REG);
-+ OUTW(BRIGHTNESS, DATA_REG);
+- OUTW(BRIGHTNESS, DATA_REG);
++ outw(BRIGHTNESS, DATA_REG);
while (inw(CST_REG) & 2) usleep(1);
-- outw(value, DATA_REG);
-+ OUTW(value, DATA_REG);
+- OUTW(value, DATA_REG);
++ outw(value, DATA_REG);
while (inw(CST_REG) & 2) usleep(1);
}
static u16 ecr_get()
{
while (inw(CST_REG) & 3) usleep(1);
-- outb(0x80, CST_REG);
-+ OUTB(0x80, CST_REG);
+- OUTB(0x80, CST_REG);
++ outb(0x80, CST_REG);
while (inw(CST_REG) & 2) usleep(1);
-- outb(BRIGHTNESS, DATA_REG);
-+ OUTB(BRIGHTNESS, DATA_REG);
+- OUTB(BRIGHTNESS, DATA_REG);
++ outb(BRIGHTNESS, DATA_REG);
while (inw(CST_REG) & 2) usleep(1);
return (inw(DATA_REG)&255);
}
-@@ -52,14 +66,17 @@
+@@ -65,17 +52,14 @@
int main(int argc, char *argv[])
{
-+#ifndef __FreeBSD__
+-#ifndef __FreeBSD__
ioperm(DATA_REG, 0x08, 1);
-+#endif
+-#endif
if( geteuid() != 0 )
fprintf(stdout, "You must be root to use %s\n", argv[0]);
else if( argc == 2 && strcmp(argv[1], "--read") == 0)
-+ {
-+ iopl(3);
+- {
+- iopl(3);
printf("%d\n", ecr_get());
--
-- else if( argc != 2 || !isdigit(argv[1][0]))
-+ } else if( argc != 2 || !isdigit(argv[1][0]))
+- } else if( argc != 2 || !isdigit(argv[1][0]))
++
++ else if( argc != 2 || !isdigit(argv[1][0]))
usage();
else