rtas.c (0ad3a96f8ad910ecf87a25ec69ed360b284dee2e) rtas.c (21fe3301f11a93c4f18e8480ed08522559bf0a50)
1/*
2 *
3 * Procedures for interfacing to the RTAS on CHRP machines.
4 *
5 * Peter Bergner, IBM March 2001.
6 * Copyright (C) 2001 IBM.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <stdarg.h>
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/spinlock.h>
18#include <linux/module.h>
19#include <linux/init.h>
1/*
2 *
3 * Procedures for interfacing to the RTAS on CHRP machines.
4 *
5 * Peter Bergner, IBM March 2001.
6 * Copyright (C) 2001 IBM.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <stdarg.h>
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/spinlock.h>
18#include <linux/module.h>
19#include <linux/init.h>
20#include <linux/delay.h>
20
21#include <asm/prom.h>
22#include <asm/rtas.h>
23#include <asm/semaphore.h>
24#include <asm/machdep.h>
25#include <asm/page.h>
26#include <asm/param.h>
27#include <asm/system.h>

--- 50 unchanged lines hidden (view full) ---

78{
79 static int pending_newline = 0; /* did last write end with unprinted newline? */
80 static int width = 16;
81
82 if (c == '\n') {
83 while (width-- > 0)
84 call_rtas_display_status(' ');
85 width = 16;
21
22#include <asm/prom.h>
23#include <asm/rtas.h>
24#include <asm/semaphore.h>
25#include <asm/machdep.h>
26#include <asm/page.h>
27#include <asm/param.h>
28#include <asm/system.h>

--- 50 unchanged lines hidden (view full) ---

79{
80 static int pending_newline = 0; /* did last write end with unprinted newline? */
81 static int width = 16;
82
83 if (c == '\n') {
84 while (width-- > 0)
85 call_rtas_display_status(' ');
86 width = 16;
86 udelay(500000);
87 mdelay(500);
87 pending_newline = 1;
88 } else {
89 if (pending_newline) {
90 call_rtas_display_status('\r');
91 call_rtas_display_status('\n');
92 }
93 pending_newline = 0;
94 if (width--) {

--- 508 unchanged lines hidden (view full) ---

603 if (copy_to_user(uargs->args + nargs,
604 args.args + nargs,
605 args.nret * sizeof(rtas_arg_t)) != 0)
606 return -EFAULT;
607
608 return 0;
609}
610
88 pending_newline = 1;
89 } else {
90 if (pending_newline) {
91 call_rtas_display_status('\r');
92 call_rtas_display_status('\n');
93 }
94 pending_newline = 0;
95 if (width--) {

--- 508 unchanged lines hidden (view full) ---

604 if (copy_to_user(uargs->args + nargs,
605 args.args + nargs,
606 args.nret * sizeof(rtas_arg_t)) != 0)
607 return -EFAULT;
608
609 return 0;
610}
611
611#ifdef CONFIG_SMP
612/* This version can't take the spinlock, because it never returns */
613
614struct rtas_args rtas_stop_self_args = {
615 /* The token is initialized for real in setup_system() */
616 .token = RTAS_UNKNOWN_SERVICE,
617 .nargs = 0,
618 .nret = 1,
619 .rets = &rtas_stop_self_args.args[0],

--- 8 unchanged lines hidden (view full) ---

628 BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE);
629
630 printk("cpu %u (hwid %u) Ready to die...\n",
631 smp_processor_id(), hard_smp_processor_id());
632 enter_rtas(__pa(rtas_args));
633
634 panic("Alas, I survived.\n");
635}
612/* This version can't take the spinlock, because it never returns */
613
614struct rtas_args rtas_stop_self_args = {
615 /* The token is initialized for real in setup_system() */
616 .token = RTAS_UNKNOWN_SERVICE,
617 .nargs = 0,
618 .nret = 1,
619 .rets = &rtas_stop_self_args.args[0],

--- 8 unchanged lines hidden (view full) ---

628 BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE);
629
630 printk("cpu %u (hwid %u) Ready to die...\n",
631 smp_processor_id(), hard_smp_processor_id());
632 enter_rtas(__pa(rtas_args));
633
634 panic("Alas, I survived.\n");
635}
636#endif
637
638/*
639 * Call early during boot, before mem init or bootmem, to retreive the RTAS
640 * informations from the device-tree and allocate the RMO buffer for userland
641 * accesses.
642 */
643void __init rtas_initialize(void)
644{

--- 53 unchanged lines hidden ---
636
637/*
638 * Call early during boot, before mem init or bootmem, to retreive the RTAS
639 * informations from the device-tree and allocate the RMO buffer for userland
640 * accesses.
641 */
642void __init rtas_initialize(void)
643{

--- 53 unchanged lines hidden ---