Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123083
b: refs/heads/master
c: edc72ac
h: refs/heads/master
i:
  123081: e485017
  123079: 6b6b465
v: v3
  • Loading branch information
Nathan Lynch authored and Paul Mackerras committed Dec 16, 2008
1 parent ab45d66 commit 9d59252
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ff04c53db97c896ecca9374c0be4f681cf5fe50
refs/heads/master: edc72ac4a0894247a6d3f1157a8ec8d603fff52d
1 change: 1 addition & 0 deletions trunk/arch/powerpc/include/asm/rtas.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ extern void rtas_os_term(char *str);
extern int rtas_get_sensor(int sensor, int index, int *state);
extern int rtas_get_power_level(int powerdomain, int *level);
extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
extern bool rtas_indicator_present(int token, int *maxindex);
extern int rtas_set_indicator(int indicator, int index, int new_value);
extern int rtas_set_indicator_fast(int indicator, int index, int new_value);
extern void rtas_progress(char *s, unsigned short hex);
Expand Down
26 changes: 26 additions & 0 deletions trunk/arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,32 @@ int rtas_get_sensor(int sensor, int index, int *state)
}
EXPORT_SYMBOL(rtas_get_sensor);

bool rtas_indicator_present(int token, int *maxindex)
{
int proplen, count, i;
const struct indicator_elem {
u32 token;
u32 maxindex;
} *indicators;

indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen);
if (!indicators)
return false;

count = proplen / sizeof(struct indicator_elem);

for (i = 0; i < count; i++) {
if (indicators[i].token != token)
continue;
if (maxindex)
*maxindex = indicators[i].maxindex;
return true;
}

return false;
}
EXPORT_SYMBOL(rtas_indicator_present);

int rtas_set_indicator(int indicator, int index, int new_value)
{
int token = rtas_token("set-indicator");
Expand Down
15 changes: 12 additions & 3 deletions trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,18 @@ static void xics_set_cpu_priority(unsigned char cppr)
/* Have the calling processor join or leave the specified global queue */
static void xics_set_cpu_giq(unsigned int gserver, unsigned int join)
{
int status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
(1UL << interrupt_server_size) - 1 - gserver, join);
WARN_ON(status < 0);
int index;
int status;

if (!rtas_indicator_present(GLOBAL_INTERRUPT_QUEUE, NULL))
return;

index = (1UL << interrupt_server_size) - 1 - gserver;

status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE, index, join);

WARN(status < 0, "set-indicator(%d, %d, %u) returned %d\n",
GLOBAL_INTERRUPT_QUEUE, index, join, status);
}

void xics_setup_cpu(void)
Expand Down

0 comments on commit 9d59252

Please sign in to comment.