Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
01386c25
Commit
01386c25
authored
Jan 30, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: rtas proc fixes from David Altobelli
parent
5c6cce95
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
21 deletions
+43
-21
arch/ppc64/Kconfig
arch/ppc64/Kconfig
+4
-0
arch/ppc64/kernel/Makefile
arch/ppc64/kernel/Makefile
+2
-1
arch/ppc64/kernel/rtas-proc.c
arch/ppc64/kernel/rtas-proc.c
+27
-15
arch/ppc64/kernel/rtasd.c
arch/ppc64/kernel/rtasd.c
+10
-5
No files found.
arch/ppc64/Kconfig
View file @
01386c25
...
...
@@ -128,6 +128,10 @@ config RTAS_FLASH
tristate "Firmware flash interface"
depends on !PPC_ISERIES
config PPC_RTAS
bool "Proc interface to RTAS"
depends on !PPC_ISERIES
endmenu
...
...
arch/ppc64/kernel/Makefile
View file @
01386c25
...
...
@@ -25,9 +25,10 @@ obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \
# Change this to pSeries only once we've got iSeries up to date
obj-y
+=
open_pic.o xics.o pSeries_htab.o rtas.o
\
rtas-proc.o
chrp_setup.o i8259.o ras.o prom.o
chrp_setup.o i8259.o ras.o prom.o
obj-$(CONFIG_RTAS_FLASH)
+=
rtas_flash.o
obj-$(CONFIG_SMP)
+=
smp.o
obj-$(CONFIG_PROFILING)
+=
profile.o
obj-$(CONFIG_MODULES)
+=
module.o ppc_ksyms.o
obj-$(CONFIG_PPC_RTAS)
+=
rtas-proc.o
arch/ppc64/kernel/rtas-proc.c
View file @
01386c25
...
...
@@ -115,9 +115,10 @@
/* Globals */
static
struct
proc_dir_entry
*
proc_rtas
;
extern
struct
proc_dir_entry
*
proc_rtas
;
static
struct
rtas_sensors
sensors
;
static
struct
device_node
*
rtas_node
;
static
struct
device_node
*
rtas_node
=
NULL
;
static
unsigned
long
power_on_time
=
0
;
/* Save the time the user set */
static
char
progress_led
[
MAX_LINELENGTH
];
...
...
@@ -200,13 +201,18 @@ void proc_rtas_init(void)
struct
proc_dir_entry
*
entry
;
rtas_node
=
find_devices
(
"rtas"
);
if
((
rtas_node
==
0
)
||
(
naca
->
platform
==
PLATFORM_ISERIES_LPAR
))
{
if
((
rtas_node
==
NULL
)
||
(
naca
->
platform
==
PLATFORM_ISERIES_LPAR
))
{
return
;
}
proc_rtas
=
proc_mkdir
(
"rtas"
,
0
);
if
(
proc_rtas
==
0
)
if
(
proc_rtas
==
NULL
)
{
proc_rtas
=
proc_mkdir
(
"rtas"
,
0
);
}
if
(
proc_rtas
==
NULL
)
{
printk
(
KERN_ERR
"Failed to create /proc/rtas in proc_rtas_init
\n
"
);
return
;
}
/* /proc/rtas entries */
...
...
@@ -405,10 +411,14 @@ static int ppc_rtas_sensor_read(char * buf, char ** start, off_t off,
j
=
sensors
.
sensor
[
i
].
quant
;
/* A sensor may have multiple instances */
while
(
j
>=
0
)
{
error
=
rtas_call
(
get_sensor_state
,
2
,
2
,
&
ret
,
sensors
.
sensor
[
i
].
token
,
sensors
.
sensor
[
i
].
quant
-
j
);
sensors
.
sensor
[
i
].
token
,
sensors
.
sensor
[
i
].
quant
-
j
);
state
=
(
int
)
ret
;
n
+=
ppc_rtas_process_sensor
(
sensors
.
sensor
[
i
],
state
,
error
,
buffer
+
n
);
n
+=
ppc_rtas_process_sensor
(
sensors
.
sensor
[
i
],
state
,
error
,
buffer
+
n
);
n
+=
sprintf
(
buffer
+
n
,
"
\n
"
);
j
--
;
}
/* while */
...
...
@@ -426,6 +436,7 @@ static int ppc_rtas_sensor_read(char * buf, char ** start, off_t off,
n
=
count
;
else
*
eof
=
1
;
memcpy
(
buf
,
buffer
+
off
,
n
);
*
start
=
buf
;
kfree
(
buffer
);
...
...
@@ -436,10 +447,10 @@ static int ppc_rtas_sensor_read(char * buf, char ** start, off_t off,
int
ppc_rtas_find_all_sensors
(
void
)
{
unsigned
long
*
utmp
;
int
len
,
i
,
j
;
unsigned
int
*
utmp
;
int
len
,
i
;
utmp
=
(
unsigned
long
*
)
get_property
(
rtas_node
,
"rtas-sensors"
,
&
len
);
utmp
=
(
unsigned
int
*
)
get_property
(
rtas_node
,
"rtas-sensors"
,
&
len
);
if
(
utmp
==
NULL
)
{
printk
(
KERN_ERR
"error: could not get rtas-sensors
\n
"
);
return
1
;
...
...
@@ -447,9 +458,9 @@ int ppc_rtas_find_all_sensors (void)
sensors
.
quant
=
len
/
8
;
/* int + int */
for
(
i
=
0
,
j
=
0
;
j
<
sensors
.
quant
;
i
+=
2
,
j
++
)
{
sensors
.
sensor
[
j
].
token
=
utmp
[
i
]
;
sensors
.
sensor
[
j
].
quant
=
utmp
[
i
+
1
]
;
for
(
i
=
0
;
i
<
sensors
.
quant
;
i
++
)
{
sensors
.
sensor
[
i
].
token
=
*
utmp
++
;
sensors
.
sensor
[
i
].
quant
=
*
utmp
++
;
}
return
0
;
}
...
...
@@ -515,6 +526,7 @@ int ppc_rtas_process_sensor(struct individual_sensor s, int state,
int
n
=
0
;
/* What kind of sensor do we have here? */
switch
(
s
.
token
)
{
case
KEY_SWITCH
:
n
+=
sprintf
(
buf
+
n
,
"Key switch:
\t
"
);
...
...
@@ -698,9 +710,9 @@ int get_location_code(struct individual_sensor s, char * buffer)
ret
=
(
char
*
)
get_property
(
rtas_node
,
rstr
,
&
llen
);
n
=
0
;
if
(
ret
[
0
]
==
'\0'
)
if
(
ret
==
NULL
||
ret
[
0
]
==
'\0'
)
{
n
+=
sprintf
(
buffer
+
n
,
"--- "
);
/* does not have a location */
else
{
}
else
{
char
t
[
50
];
ret
+=
pos
;
...
...
arch/ppc64/kernel/rtasd.c
View file @
01386c25
...
...
@@ -49,6 +49,8 @@ static unsigned int rtas_error_log_max;
#define SURVEILLANCE_TIMEOUT 1
#define SURVEILLANCE_SCANRATE 1
struct
proc_dir_entry
*
proc_rtas
;
/*
* Since we use 32 bit RTAS, the physical address of this must be below
* 4G or else bad things happen. Allocate this in the kernel data and
...
...
@@ -270,13 +272,16 @@ static int rtasd(void *unused)
static
int
__init
rtas_init
(
void
)
{
struct
proc_dir_entry
*
rtas_dir
,
*
entry
;
struct
proc_dir_entry
*
entry
;
if
(
proc_rtas
==
NULL
)
{
proc_rtas
=
proc_mkdir
(
"rtas"
,
0
);
}
rtas_dir
=
proc_mkdir
(
"rtas"
,
0
);
if
(
!
rtas_dir
)
{
printk
(
KERN_ERR
"Failed to create rtas proc directory
\n
"
);
if
(
proc_rtas
==
NULL
)
{
printk
(
KERN_ERR
"Failed to create /proc/rtas in rtas_init
\n
"
);
}
else
{
entry
=
create_proc_entry
(
"error_log"
,
S_IRUSR
,
rtas_dir
);
entry
=
create_proc_entry
(
"error_log"
,
S_IRUSR
,
proc_rtas
);
if
(
entry
)
entry
->
proc_fops
=
&
proc_rtas_log_operations
;
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment