* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/smp_lock.h>
#include <linux/limits.h>
#include <linux/mm.h>
#include <linux/smp.h>
-#include <linux/tty.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/timex.h>
#include <asm/oplib.h>
#include <asm/idprom.h>
#include <asm/smp.h>
-#include <asm/prom.h>
#include "conv.h"
}
}
-static char *platform(char *buffer, int sz)
+static char *platform(char *buffer)
{
- struct device_node *dp = of_find_node_by_path("/");
int len;
*buffer = 0;
- len = strlen(dp->name);
- if (len > sz)
- len = sz;
- memcpy(buffer, dp->name, len);
- buffer[len] = 0;
+ len = prom_getproperty(prom_root_node, "name", buffer, 256);
+ if(len > 0)
+ buffer[len] = 0;
if (*buffer) {
char *p;
return "sun4u";
}
-static char *serial(char *buffer, int sz)
+static char *serial(char *buffer)
{
- struct device_node *dp = of_find_node_by_path("/options");
+ int node = prom_getchild(prom_root_node);
int len;
+ node = prom_searchsiblings(node, "options");
*buffer = 0;
- if (dp) {
- char *val = of_get_property(dp, "system-board-serial#", &len);
-
- if (val && len > 0) {
- if (len > sz)
- len = sz;
- memcpy(buffer, val, len);
- buffer[len] = 0;
- }
- }
+ len = prom_getproperty(node, "system-board-serial#", buffer, 256);
+ if(len > 0)
+ buffer[len] = 0;
if (!*buffer)
return "4512348717234";
else
case SI_MACHINE: r = machine(); break;
case SI_ARCHITECTURE: r = "sparc"; break;
case SI_HW_PROVIDER: r = "Sun_Microsystems"; break;
- case SI_HW_SERIAL: r = serial(buffer, sizeof(buffer)); break;
- case SI_PLATFORM: r = platform(buffer, sizeof(buffer)); break;
+ case SI_HW_SERIAL: r = serial(buffer); break;
+ case SI_PLATFORM: r = platform(buffer); break;
case SI_SRPC_DOMAIN: r = ""; break;
case SI_VERSION: r = "Generic"; break;
default: return -EINVAL;
Solaris setpgrp and setsid? */
ret = sys_setpgid(0, 0);
if (ret) return ret;
- proc_clear_tty(current);
+ current->signal->tty = NULL;
return process_group(current);
}
case 2: /* getsid */