Re: [AD] Porting Allegro to the PS2

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 07 June 2002 20:13, Eric Botcazou wrote:
> I think we have to fix the machinery so that ALLEGRO_LINUX_VGA is not
> defined if ALLEGRO_NO_ASM is defined.

Attached is a patch which wraps any VGA-specific code (ie. the code 
causing Joshua problems) in a preprocessor test for ALLEGRO_LINUX_VGA. 
Since all the iopl() calls were connected with VGA code, I also wrapped 
them in a test for this macro. The logic for this decision is simple: 
VGA is only available on Linux/i386, iopl() is only available on 
Linux/i386, so the presence of one determines the presence of the 
other.

I'm going to have to disagree with George about the relevance of the 
Linux driver on the PS/2, because I think the mouse, keyboard, timer 
and sound drivers are all relevant. There is also the possibility of 
framebuffer support being added.

As to your specific comment above, you are probably correct, but I don't 
want to touch autoconf stuff :-)

Bye for now,
- -- 
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9AS8DUdhclgSmRuoRAi1CAJoCNscvvL758kthL60WQwZePfl+hwCgor5R
MEbiKcrUfsC5JVrs07TtUuA=
=Qadp
-----END PGP SIGNATURE-----
diff -rub allegro/include/allegro/platform/alunix.h allegro-new/include/allegro/platform/alunix.h
--- allegro/include/allegro/platform/alunix.h	Thu Jun  6 11:58:17 2002
+++ allegro-new/include/allegro/platform/alunix.h	Fri Jun  7 22:59:53 2002
@@ -249,6 +249,8 @@
 AL_FUNC(void, split_modex_screen, (int line));
 
 
+#ifdef ALLEGRO_LINUX_VGA
+
 /* Port I/O functions -- maybe these should be internal */
 
 static INLINE void outportb(unsigned short port, unsigned char value)
@@ -286,6 +288,9 @@
    __asm__ volatile ("inl %1, %0" : "=a" (value) : "d" (port));
    return value;
 }
+
+#endif /* ALLEGRO_LINUX_VGA */
+
 
 
 #endif /* ALLEGRO_LINUX */
diff -rub allegro/src/linux/lsystem.c allegro-new/src/linux/lsystem.c
--- allegro/src/linux/lsystem.c	Fri May 17 17:12:02 2002
+++ allegro-new/src/linux/lsystem.c	Fri Jun  7 23:02:03 2002
@@ -165,12 +165,14 @@
 	_read_os_type();
 	if (os_type != OSTYPE_LINUX) return -1; /* FWIW */
 
+#ifdef ALLEGRO_LINUX_VGA
 	/* This is the only bit that needs root privileges.  First
 	 * we attempt to set our euid to 0, in case this is the
 	 * second time we've been called. */
 	__al_linux_have_ioperms  = !seteuid (0);
 	__al_linux_have_ioperms &= !iopl (3);
 	__al_linux_have_ioperms &= !__al_linux_init_memory();
+#endif
 
 	/* At this stage we can drop the root privileges. */
 	seteuid (getuid());
@@ -252,7 +254,9 @@
 	_unix_driver_lists_shutdown();
 
 	__al_linux_shutdown_memory();
+#ifdef ALLEGRO_LINUX_VGA
 	iopl (0);
+#endif
 }
 
 
diff -rub allegro/src/unix/uptimer.c allegro-new/src/unix/uptimer.c
--- allegro/src/unix/uptimer.c	Thu Mar 28 12:21:22 2002
+++ allegro-new/src/unix/uptimer.c	Fri Jun  7 23:03:39 2002
@@ -89,7 +89,7 @@
 
    block_all_signals();
 
-#ifdef ALLEGRO_LINUX
+#ifdef ALLEGRO_LINUX_VGA
    /* privileges hack for Linux:
     *  One of the jobs of the timer thread is to update the mouse pointer
     *  on screen.  When using the Mode-X driver under Linux console, this


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/