linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / powerpc / kernel / lparcfg.c
index 2cbde86..e789fef 100644 (file)
@@ -37,7 +37,7 @@
 #include <asm/prom.h>
 #include <asm/vdso_datapage.h>
 
-#define MODULE_VERS "1.7"
+#define MODULE_VERS "1.6"
 #define MODULE_NAME "lparcfg"
 
 /* #define LPARCFG_DEBUG */
@@ -56,7 +56,7 @@ static unsigned long get_purr(void)
        unsigned long sum_purr = 0;
        int cpu;
 
-       for_each_possible_cpu(cpu) {
+       for_each_cpu(cpu) {
                sum_purr += lppaca[cpu].emulated_time_base;
 
 #ifdef PURR_DEBUG
@@ -149,17 +149,17 @@ static void log_plpar_hcall_return(unsigned long rc, char *tag)
        if (rc == 0)            /* success, return */
                return;
 /* check for null tag ? */
-       if (rc == H_HARDWARE)
+       if (rc == H_Hardware)
                printk(KERN_INFO
                       "plpar-hcall (%s) failed with hardware fault\n", tag);
-       else if (rc == H_FUNCTION)
+       else if (rc == H_Function)
                printk(KERN_INFO
                       "plpar-hcall (%s) failed; function not allowed\n", tag);
-       else if (rc == H_AUTHORITY)
+       else if (rc == H_Authority)
                printk(KERN_INFO
-                      "plpar-hcall (%s) failed; not authorized to this"
-                      " function\n", tag);
-       else if (rc == H_PARAMETER)
+                      "plpar-hcall (%s) failed; not authorized to this function\n",
+                      tag);
+       else if (rc == H_Parameter)
                printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
                       tag);
        else
@@ -209,7 +209,7 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs)
        unsigned long dummy;
        rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
 
-       if (rc != H_AUTHORITY)
+       if (rc != H_Authority)
                log_plpar_hcall_return(rc, "H_PIC");
 }
 
@@ -222,7 +222,7 @@ static unsigned long get_purr(void)
        int cpu;
        struct cpu_usage *cu;
 
-       for_each_possible_cpu(cpu) {
+       for_each_cpu(cpu) {
                cu = &per_cpu(cpu_usage_array, cpu);
                sum_purr += cu->current_tb;
        }
@@ -242,7 +242,7 @@ static void parse_system_parameter_string(struct seq_file *m)
 {
        int call_status;
 
-       unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
+       char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
        if (!local_buffer) {
                printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
                       __FILE__, __FUNCTION__, __LINE__);
@@ -254,8 +254,7 @@ static void parse_system_parameter_string(struct seq_file *m)
        call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
                                NULL,
                                SPLPAR_CHARACTERISTICS_TOKEN,
-                               __pa(rtas_data_buf),
-                               RTAS_DATA_BUF_SIZE);
+                               __pa(rtas_data_buf));
        memcpy(local_buffer, rtas_data_buf, SPLPAR_MAXLENGTH);
        spin_unlock(&rtas_data_buf_lock);
 
@@ -276,7 +275,7 @@ static void parse_system_parameter_string(struct seq_file *m)
 #ifdef LPARCFG_DEBUG
                printk(KERN_INFO "success calling get-system-parameter \n");
 #endif
-               splpar_strlen = local_buffer[0] * 256 + local_buffer[1];
+               splpar_strlen = local_buffer[0] * 16 + local_buffer[1];
                local_buffer += 2;      /* step over strlen value */
 
                memset(workbuffer, 0, SPLPAR_MAXLENGTH);
@@ -530,13 +529,13 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
        retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
                                    *new_weight_ptr);
 
-       if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
+       if (retval == H_Success || retval == H_Constrained) {
                retval = count;
-       } else if (retval == H_BUSY) {
+       } else if (retval == H_Busy) {
                retval = -EBUSY;
-       } else if (retval == H_HARDWARE) {
+       } else if (retval == H_Hardware) {
                retval = -EIO;
-       } else if (retval == H_PARAMETER) {
+       } else if (retval == H_Parameter) {
                retval = -EINVAL;
        } else {
                printk(KERN_WARNING "%s: received unknown hv return code %ld",