lkml.org 
[lkml]   [2004]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [ACPI] Re: [PATCH] filling in ACPI method access via sysfs namespace
Hi!

> > It seems unintuitive that you have to read the file for the method to
> > take effect. How about having the write function invoke the method and
> > (if there is a result) store it for later read-back via the read function?
> > It should be discarded on close, of course. A read() on a file with
> > no stored result should invoke the ACPI method (on the assumption this
> > is a parameter-less method) and return the result directly. Closing a
> > file should discard any result from the method.
>
> How's this? It behaves the way you described, but might be doing
> some questionable things with the buffer to get there. Is there a
> better place to store the return data than back into the buf passed to
> write() (aka file->private_data)? Without adding callbacks to
> open/close, I'm not sure how else we can dispose of the results on
> close. Thanks,


> + /*
> + * For convenience, handle cases where the last argument
> + * is too small.
> + */
> + count = length / sizeof(union acpi_object);
> + if (length % sizeof(union acpi_object))
> + count++;
> +
> + if (count) {
> + size = sizeof(struct acpi_object_list) +
> + ((count - 1) * sizeof(union acpi_object *));

This probably makes it *way* too implementation dependand.
Pavel
--
When do you have heart between your knees?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.054 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site