Patchwork [3/6] lib: acpica: set various ACPICA global mode flags depending on acpica_mode

login
register
mail settings
Submitter Colin King
Date July 9, 2013, 10:03 a.m.
Message ID <1373364197-14442-4-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/257686/
State Accepted
Headers show

Comments

Colin King - July 9, 2013, 10:03 a.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/fwts_acpica.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Keng-Yu Lin - July 11, 2013, 9:53 a.m.
On Tue, Jul 9, 2013 at 6:03 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpica/fwts_acpica.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index a0b551e..ac76e6e 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -876,6 +876,9 @@ void fwts_acpcia_set_fwts_framework(fwts_framework *fw)
>         fwts_acpica_fw = fw;
>  }
>
> +#define FWTS_ACPICA_MODE(fw, mode)     \
> +       (((fw->acpica_mode & mode) == mode) ? 1 : 0)
> +
>  /*
>   *  fwts_acpica_init()
>   *     Initialise ACPICA core engine
> @@ -891,6 +894,15 @@ int fwts_acpica_init(fwts_framework *fw)
>         if (fwts_acpica_init_called)
>                 return FWTS_ERROR;
>
> +       AcpiGbl_AllMethodsSerialized =
> +               FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SERIALIZED);
> +       AcpiGbl_EnableInterpreterSlack =
> +               FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SLACK);
> +       AcpiGbl_IgnoreErrors =
> +               FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_IGNORE_ERRORS);
> +       AcpiGbl_DisableAutoRepair =
> +               FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_DISABLE_AUTO_REPAIR);
> +
>         pthread_mutex_init(&mutex_lock_sem_table, NULL);
>         pthread_mutex_init(&mutex_thread_info, NULL);
>
> --
> 1.8.1.2
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - July 12, 2013, 2:42 a.m.
On 07/09/2013 06:03 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/fwts_acpica.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index a0b551e..ac76e6e 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -876,6 +876,9 @@ void fwts_acpcia_set_fwts_framework(fwts_framework *fw)
>   	fwts_acpica_fw = fw;
>   }
>
> +#define FWTS_ACPICA_MODE(fw, mode)	\
> +	(((fw->acpica_mode & mode) == mode) ? 1 : 0)
> +
>   /*
>    *  fwts_acpica_init()
>    *	Initialise ACPICA core engine
> @@ -891,6 +894,15 @@ int fwts_acpica_init(fwts_framework *fw)
>   	if (fwts_acpica_init_called)
>   		return FWTS_ERROR;
>
> +	AcpiGbl_AllMethodsSerialized =
> +		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SERIALIZED);
> +	AcpiGbl_EnableInterpreterSlack =
> +		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SLACK);
> +	AcpiGbl_IgnoreErrors =
> +		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_IGNORE_ERRORS);
> +	AcpiGbl_DisableAutoRepair =
> +		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_DISABLE_AUTO_REPAIR);
> +
>   	pthread_mutex_init(&mutex_lock_sem_table, NULL);
>   	pthread_mutex_init(&mutex_thread_info, NULL);
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
index a0b551e..ac76e6e 100644
--- a/src/acpica/fwts_acpica.c
+++ b/src/acpica/fwts_acpica.c
@@ -876,6 +876,9 @@  void fwts_acpcia_set_fwts_framework(fwts_framework *fw)
 	fwts_acpica_fw = fw;
 }
 
+#define FWTS_ACPICA_MODE(fw, mode)	\
+	(((fw->acpica_mode & mode) == mode) ? 1 : 0)
+
 /*
  *  fwts_acpica_init()
  *	Initialise ACPICA core engine
@@ -891,6 +894,15 @@  int fwts_acpica_init(fwts_framework *fw)
 	if (fwts_acpica_init_called)
 		return FWTS_ERROR;
 
+	AcpiGbl_AllMethodsSerialized =
+		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SERIALIZED);
+	AcpiGbl_EnableInterpreterSlack =
+		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_SLACK);
+	AcpiGbl_IgnoreErrors =
+		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_IGNORE_ERRORS);
+	AcpiGbl_DisableAutoRepair =
+		FWTS_ACPICA_MODE(fw, FWTS_ACPICA_MODE_DISABLE_AUTO_REPAIR);
+
 	pthread_mutex_init(&mutex_lock_sem_table, NULL);
 	pthread_mutex_init(&mutex_thread_info, NULL);