Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f071903 authored by Bob Moore's avatar Bob Moore Committed by Len Brown
Browse files

ACPICA: New: I/O port protection



Protect certain I/O ports from reads/writes. Provides MS
compatibility. New module, hwvalid.c

Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 20869dcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ obj-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
	 excreate.o  exmisc.o   exoparg2.o  exregion.o  exstore.o   exutils.o \
	 exdump.o    exmutex.o  exoparg3.o  exresnte.o  exstoren.o

obj-y += hwacpi.o  hwgpe.o  hwregs.o  hwsleep.o hwxface.o
obj-y += hwacpi.o  hwgpe.o  hwregs.o  hwsleep.o hwxface.o hwvalid.o

obj-$(ACPI_FUTURE_USAGE) += hwtimer.o

+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
ACPI_EXTERN u8 acpi_gbl_events_initialized;
ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
ACPI_EXTERN u8 acpi_gbl_osi_data;

#ifndef DEFINE_ACPI_GLOBALS

+7 −0
Original line number Diff line number Diff line
@@ -72,6 +72,13 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value);

acpi_status acpi_hw_clear_acpi_status(void);

/*
 * hwvalid - Port I/O with validation
 */
acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);

acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);

/*
 * hwgpe - GPE support
 */
+24 −0
Original line number Diff line number Diff line
@@ -863,6 +863,30 @@ struct acpi_bit_register_info {

#define ACPI_BITPOSITION_ARB_DISABLE            0x00

/* Structs and definitions for _OSI support and I/O port validation */

#define ACPI_OSI_WIN_2000               0x01
#define ACPI_OSI_WIN_XP                 0x02
#define ACPI_OSI_WIN_XP_SP1             0x03
#define ACPI_OSI_WINSRV_2003            0x04
#define ACPI_OSI_WIN_XP_SP2             0x05
#define ACPI_OSI_WINSRV_2003_SP1        0x06
#define ACPI_OSI_WIN_VISTA              0x07

#define ACPI_ALWAYS_ILLEGAL             0x00

struct acpi_interface_info {
	char *name;
	u8 value;
};

struct acpi_port_info {
	char *name;
	u16 start;
	u16 end;
	u8 osi_dependency;
};

/*****************************************************************************
 *
 * Resource descriptors
+2 −2
Original line number Diff line number Diff line
@@ -294,14 +294,14 @@ acpi_ex_system_io_space_handler(u32 function,
	switch (function) {
	case ACPI_READ:

		status = acpi_os_read_port((acpi_io_address) address,
		status = acpi_hw_read_port((acpi_io_address) address,
					   &value32, bit_width);
		*value = value32;
		break;

	case ACPI_WRITE:

		status = acpi_os_write_port((acpi_io_address) address,
		status = acpi_hw_write_port((acpi_io_address) address,
					    (u32) * value, bit_width);
		break;

Loading