[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] Export function XHNewCookie to kernel modules



Hi,

Some time ago I had here a conversation with myself about installing
XHDI drivers under MiNT.

http://sparemint.atariforge.net/mailinglist/Mailing-Lists/MiNT-List.201011/AANLkTinMGk_i9w2M31wAyuZuO190OFVpOGTp-+YZ0HLu@mail.gmail.com.text

To solve the situation mentioned in the mails above I proposed the
patch attached.

Description:
"Export the XHDI function XHNewCookie to kernel modules (using kentry
struct) to be able to install XHDI drivers."
Index: kentry.c
===================================================================
RCS file: /mint/freemint/sys/kentry.c,v
retrieving revision 1.15
diff -u -8 -p -r1.15 kentry.c
--- kentry.c	13 Jul 2007 21:32:48 -0000	1.15
+++ kentry.c	13 Dec 2010 10:18:17 -0000
@@ -57,17 +57,17 @@
 # include "semaphores.h"	/* semaphore_* */
 # include "signal.h"		/* ikill */
 # include "syscall_vectors.h"	/* bios_tab, dos_tab */
 # include "time.h"		/* xtime */
 # include "timeout.h"		/* nap, addtimeout, canceltimeout, addroottimeout, cancelroottimeout */
 # include "umemory.h"		/* umalloc, ufree */
 # include "util.h"		/* pid2proc */
 # include "xfs_xdd.h"
-
+# include "xhdi.h"		/* XHNewCookie */
 
 # undef DEFAULT_MODE
 # undef DEFAULT_DIRMODE
 
 # define DEFAULT_MODE		(0644)
 # define DEFAULT_DIRMODE	(0755)
 
 
Index: libkern/kernel_module.h
===================================================================
RCS file: /mint/freemint/sys/libkern/kernel_module.h,v
retrieving revision 1.35
diff -u -8 -p -r1.35 kernel_module.h
--- libkern/kernel_module.h	13 Jan 2010 17:14:50 -0000	1.35
+++ libkern/kernel_module.h	13 Dec 2010 10:18:18 -0000
@@ -926,16 +926,17 @@ check_kentry_version(void)
 # define remaining_proc_time	(*KENTRY->vec_misc.remaining_proc_time)
 
 # define trap_1_emu		(*KENTRY->vec.misc.trap_1_emu)
 # define trap_13_emu		(*KENTRY->vec.misc.trap_13_emu)
 # define trap_14_emu		(*KENTRY->vec.misc.trap_14_emu)
 
 # define ROM_Setexc(vnum,vptr)	(void (*)(void))trap_13_emu(0x05,(short)(vnum),(long)(vptr))
 
+# define XHNewCookie		(*KENTRY->vec_misc.XHNewCookie)
 
 /*
  * kentry_debug
  */
 # define DEBUG_LEVEL		(*KENTRY->vec_debug.debug_level)
 # define KERNEL_TRACE		(*KENTRY->vec_debug.trace)
 # define KERNEL_DEBUG		(*KENTRY->vec_debug.debug)
 # define KERNEL_ALERT		(*KENTRY->vec_debug.alert)
Index: mint/kentry.h
===================================================================
RCS file: /mint/freemint/sys/mint/kentry.h,v
retrieving revision 1.36
diff -u -8 -p -r1.36 kentry.h
--- mint/kentry.h	4 Jan 2010 22:22:11 -0000	1.36
+++ mint/kentry.h	13 Dec 2010 10:18:19 -0000
@@ -552,31 +552,38 @@ struct kentry_misc
 	unsigned long _cdecl (*remaining_proc_time)(void);
 
 	/*
 	 * TOS trap vectors
 	 */
 	long _cdecl (*trap_1_emu)(short fnum, ...);
 	long _cdecl (*trap_13_emu)(short fnum, ...);
 	long _cdecl (*trap_14_emu)(short fnum, ...);
+
+	/*
+	 * function to install XHDI drivers
+	 */
+	long _cdecl (*XHNewCookie)(void *newcookie);
+	
 };
 #define DEFAULTS_kentry_misc \
 { \
 	&dma, \
 	\
 	get_toscookie, \
 	\
 	add_rsvfentry, \
 	del_rsvfentry, \
 	\
 	remaining_proc_time, \
 	\
 	trap_1_emu, \
 	trap_13_emu, \
 	trap_14_emu, \
+	XHNewCookie, \
 }
 
 
 /* debug support
  */
 struct kentry_debug
 {
 	/* Debugging stuff