Skip to content

Commit e28b05e

Browse files
shenkiozbenh
authored andcommitted
powerpc/powernv: Add invalid OPAL call
This call will not be understood by OPAL, and cause it to add an error to it's log. Among other things, this is useful for testing the behaviour of the log as it fills up. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent bfc3689 commit e28b05e

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎arch/powerpc/include/asm/opal.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ extern int opal_enter_rtas(struct rtas_args *args,
8787
#define OPAL_ASYNC_COMPLETION -15
8888

8989
/* API Tokens (in r0) */
90+
#define OPAL_INVALID_CALL -1
9091
#define OPAL_CONSOLE_WRITE 1
9192
#define OPAL_CONSOLE_READ 2
9293
#define OPAL_RTC_READ 3
@@ -734,6 +735,7 @@ extern struct kobject *opal_kobj;
734735
extern struct device_node *opal_node;
735736

736737
/* API functions */
738+
int64_t opal_invalid_call(void);
737739
int64_t opal_console_write(int64_t term_number, __be64 *length,
738740
const uint8_t *buffer);
739741
int64_t opal_console_read(int64_t term_number, __be64 *length,

‎arch/powerpc/platforms/powernv/opal-wrappers.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ _STATIC(opal_return)
6161
mtcr r4;
6262
rfid
6363

64+
OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL);
6465
OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE);
6566
OPAL_CALL(opal_console_read, OPAL_CONSOLE_READ);
6667
OPAL_CALL(opal_console_write_buffer_space, OPAL_CONSOLE_WRITE_BUFFER_SPACE);

‎arch/powerpc/platforms/powernv/opal.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,3 +635,6 @@ void opal_shutdown(void)
635635
mdelay(10);
636636
}
637637
}
638+
639+
/* Export this so that test modules can use it */
640+
EXPORT_SYMBOL_GPL(opal_invalid_call);

0 commit comments

Comments
 (0)