Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops 
0003  *
0004  * Copyright (c) 1996-2000  Jonathan A. Buzzard (jonathan@buzzard.org.uk)
0005  * Copyright (c) 2015  Azael Avalos <coproscefalo@gmail.com>
0006  *
0007  * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
0008  * on making sure the structure is aligned and packed.
0009  *
0010  * This program is free software; you can redistribute it and/or modify it
0011  * under the terms of the GNU General Public License as published by the
0012  * Free Software Foundation; either version 2, or (at your option) any
0013  * later version.
0014  *
0015  * This program is distributed in the hope that it will be useful, but
0016  * WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018  * General Public License for more details.
0019  *
0020  */
0021 
0022 #ifndef _UAPI_LINUX_TOSHIBA_H
0023 #define _UAPI_LINUX_TOSHIBA_H
0024 
0025 /*
0026  * Toshiba modules paths
0027  */
0028 
0029 #define TOSH_PROC       "/proc/toshiba"
0030 #define TOSH_DEVICE     "/dev/toshiba"
0031 #define TOSHIBA_ACPI_PROC   "/proc/acpi/toshiba"
0032 #define TOSHIBA_ACPI_DEVICE "/dev/toshiba_acpi"
0033 
0034 /*
0035  * Toshiba SMM structure
0036  */
0037 
0038 typedef struct {
0039     unsigned int eax;
0040     unsigned int ebx __attribute__ ((packed));
0041     unsigned int ecx __attribute__ ((packed));
0042     unsigned int edx __attribute__ ((packed));
0043     unsigned int esi __attribute__ ((packed));
0044     unsigned int edi __attribute__ ((packed));
0045 } SMMRegisters;
0046 
0047 /*
0048  * IOCTLs (0x90 - 0x91)
0049  */
0050 
0051 #define TOSH_SMM        _IOWR('t', 0x90, SMMRegisters)
0052 /*
0053  * Convenience toshiba_acpi command.
0054  *
0055  * The System Configuration Interface (SCI) is opened/closed internally
0056  * to avoid userspace of buggy BIOSes.
0057  *
0058  * The toshiba_acpi module checks whether the eax register is set with
0059  * SCI_GET (0xf300) or SCI_SET (0xf400), returning -EINVAL if not.
0060  */
0061 #define TOSHIBA_ACPI_SCI    _IOWR('t', 0x91, SMMRegisters)
0062 
0063 
0064 #endif /* _UAPI_LINUX_TOSHIBA_H */