dmi-sysfs.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) dmi-sysfs.c (f7750a79568788473c5e8092ee58a52248f34329)
1/*
2 * dmi-sysfs.c
3 *
4 * This module exports the DMI tables read-only to userspace through the
5 * sysfs file system.
6 *
7 * Data is currently found below
8 * /sys/firmware/dmi/...

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

20#include <linux/module.h>
21#include <linux/types.h>
22#include <linux/kobject.h>
23#include <linux/dmi.h>
24#include <linux/capability.h>
25#include <linux/slab.h>
26#include <linux/list.h>
27#include <linux/io.h>
1/*
2 * dmi-sysfs.c
3 *
4 * This module exports the DMI tables read-only to userspace through the
5 * sysfs file system.
6 *
7 * Data is currently found below
8 * /sys/firmware/dmi/...

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

20#include <linux/module.h>
21#include <linux/types.h>
22#include <linux/kobject.h>
23#include <linux/dmi.h>
24#include <linux/capability.h>
25#include <linux/slab.h>
26#include <linux/list.h>
27#include <linux/io.h>
28#include <asm/dmi.h>
28
29#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
30 the top entry type is only 8 bits */
31
32struct dmi_sysfs_entry {
33 struct dmi_header dh;
34 struct kobject kobj;
35 int instance;

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

375
376static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
377 const struct dmi_system_event_log *sel,
378 char *buf, loff_t pos, size_t count)
379{
380 u8 __iomem *mapped;
381 ssize_t wrote = 0;
382
29
30#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
31 the top entry type is only 8 bits */
32
33struct dmi_sysfs_entry {
34 struct dmi_header dh;
35 struct kobject kobj;
36 int instance;

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

376
377static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
378 const struct dmi_system_event_log *sel,
379 char *buf, loff_t pos, size_t count)
380{
381 u8 __iomem *mapped;
382 ssize_t wrote = 0;
383
383 mapped = ioremap(sel->access_method_address, sel->area_length);
384 mapped = dmi_remap(sel->access_method_address, sel->area_length);
384 if (!mapped)
385 return -EIO;
386
387 while (count && pos < sel->area_length) {
388 count--;
389 *(buf++) = readb(mapped + pos++);
390 wrote++;
391 }
392
385 if (!mapped)
386 return -EIO;
387
388 while (count && pos < sel->area_length) {
389 count--;
390 *(buf++) = readb(mapped + pos++);
391 wrote++;
392 }
393
393 iounmap(mapped);
394 dmi_unmap(mapped);
394 return wrote;
395}
396
397static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry,
398 const struct dmi_header *dh,
399 void *_state)
400{
401 struct dmi_read_state *state = _state;

--- 295 unchanged lines hidden ---
395 return wrote;
396}
397
398static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry,
399 const struct dmi_header *dh,
400 void *_state)
401{
402 struct dmi_read_state *state = _state;

--- 295 unchanged lines hidden ---