CVSROOT: /home/cvs
Module name: malta
Changes by: beth@ftp.linux-mips.org 05/09/16 11:39:32
Modified files:
linux/arch/mips/kernel: Tag: MaltaRef_2_6 kspd.c
Log message:
Added further MTSP syscalls.
diff -urN malta/linux/arch/mips/kernel/kspd.c
malta/linux/arch/mips/kernel/kspd.c
--- malta/linux/arch/mips/kernel/Attic/kspd.c 2005/09/02 17:02:54
1.1.1000.5
+++ malta/linux/arch/mips/kernel/Attic/kspd.c 2005/09/16 10:39:32
1.1.1000.6
@@ -31,6 +31,8 @@
static struct workqueue_struct *workqueue = NULL;
static struct work_struct work;
+extern unsigned long cpu_khz;
+
struct mtsp_syscall {
int cmd;
unsigned char abi;
@@ -57,12 +59,17 @@
/* these should match with those in the SDE kit */
#define MTSP_SYSCALL_BASE 0
-#define MTSP_SYSCALL_EXIT (MTSP_SYSCALL_BASE + 0)
-#define MTSP_SYSCALL_OPEN (MTSP_SYSCALL_BASE + 1)
-#define MTSP_SYSCALL_READ (MTSP_SYSCALL_BASE + 2)
-#define MTSP_SYSCALL_WRITE (MTSP_SYSCALL_BASE + 3)
-#define MTSP_SYSCALL_CLOSE (MTSP_SYSCALL_BASE + 4)
-#define MTSP_SYSCALL_LSEEK32 (MTSP_SYSCALL_BASE + 5)
+#define MTSP_SYSCALL_EXIT (MTSP_SYSCALL_BASE + 0)
+#define MTSP_SYSCALL_OPEN (MTSP_SYSCALL_BASE + 1)
+#define MTSP_SYSCALL_READ (MTSP_SYSCALL_BASE + 2)
+#define MTSP_SYSCALL_WRITE (MTSP_SYSCALL_BASE + 3)
+#define MTSP_SYSCALL_CLOSE (MTSP_SYSCALL_BASE + 4)
+#define MTSP_SYSCALL_LSEEK32 (MTSP_SYSCALL_BASE + 5)
+#define MTSP_SYSCALL_ISATTY (MTSP_SYSCALL_BASE + 6)
+#define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7)
+#define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8)
+#define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9)
+
#define MTSP_O_RDONLY 0x0000
#define MTSP_O_WRONLY 0x0001
@@ -183,6 +190,9 @@
struct mtsp_syscall_generic generic;
struct mtsp_syscall_ret ret;
struct kspd_notifications *n;
+ struct timeval tv;
+ struct timezone tz;
+
char *vcwd;
mm_segment_t old_fs;
int size;
@@ -210,10 +220,21 @@
sp_setfsuidgid( vpe_getuid(SP_VPE), vpe_getgid(SP_VPE));
switch (sc.cmd) {
-
- /* needs the flags argument translating from SDE kit to
- linux */
+ case MTSP_SYSCALL_PIPEFREQ:
+ ret.retval = cpu_khz * 1000;
+ ret.errno = 0;
+ break;
+
+ case MTSP_SYSCALL_GETTOD:
+ memset(&tz, 0, sizeof(tz));
+ if ((ret.retval = sp_syscall(__NR_gettimeofday,
(int)&tv,
+ (int)&tz, 0,0)) == 0)
+ ret.retval = tv.tv_sec;
+
+ ret.errno = errno;
+ break;
+
case MTSP_SYSCALL_EXIT:
list_for_each_entry(n, &kspd_notifylist, list) {
n->kspd_sp_exit(SP_VPE);
|