Deleted Added
full compact
exoparg3.c (91116) exoparg3.c (99679)
1
2/******************************************************************************
3 *
4 * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
1
2/******************************************************************************
3 *
4 * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
5 * $Revision: 9 $
5 * $Revision: 14 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

176
177
178 switch (WalkState->Opcode)
179 {
180
181 case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
182
183 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

176
177
178 switch (WalkState->Opcode)
179 {
180
181 case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
182
183 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
184 "FatalOp: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
184 "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
185 (UINT32) Operand[0]->Integer.Value, (UINT32) Operand[1]->Integer.Value,
186 (UINT32) Operand[2]->Integer.Value));
187
188
189 Fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
190 if (Fatal)
191 {
192 Fatal->Type = (UINT32) Operand[0]->Integer.Value;
193 Fatal->Code = (UINT32) Operand[1]->Integer.Value;
194 Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
195 }
196
197 /*
198 * Always signal the OS!
199 */
185 (UINT32) Operand[0]->Integer.Value, (UINT32) Operand[1]->Integer.Value,
186 (UINT32) Operand[2]->Integer.Value));
187
188
189 Fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
190 if (Fatal)
191 {
192 Fatal->Type = (UINT32) Operand[0]->Integer.Value;
193 Fatal->Code = (UINT32) Operand[1]->Integer.Value;
194 Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
195 }
196
197 /*
198 * Always signal the OS!
199 */
200 AcpiOsSignal (ACPI_SIGNAL_FATAL, Fatal);
200 Status = AcpiOsSignal (ACPI_SIGNAL_FATAL, Fatal);
201
202 /* Might return while OS is shutting down, just continue */
203
204 ACPI_MEM_FREE (Fatal);
205 break;
206
207
208 default:

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

235ACPI_STATUS
236AcpiExOpcode_3A_1T_1R (
237 ACPI_WALK_STATE *WalkState)
238{
239 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
240 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
241 char *Buffer;
242 ACPI_STATUS Status = AE_OK;
201
202 /* Might return while OS is shutting down, just continue */
203
204 ACPI_MEM_FREE (Fatal);
205 break;
206
207
208 default:

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

235ACPI_STATUS
236AcpiExOpcode_3A_1T_1R (
237 ACPI_WALK_STATE *WalkState)
238{
239 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
240 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
241 char *Buffer;
242 ACPI_STATUS Status = AE_OK;
243 UINT32 Index;
244 UINT32 Length;
243 NATIVE_UINT Index;
244 ACPI_SIZE Length;
245
246
247 ACPI_FUNCTION_TRACE_STR ("ExOpcode_3A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
248
249
250 switch (WalkState->Opcode)
251 {
252 case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
253
254 /*
255 * Create the return object. The Source operand is guaranteed to be
256 * either a String or a Buffer, so just use its type.
257 */
245
246
247 ACPI_FUNCTION_TRACE_STR ("ExOpcode_3A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
248
249
250 switch (WalkState->Opcode)
251 {
252 case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
253
254 /*
255 * Create the return object. The Source operand is guaranteed to be
256 * either a String or a Buffer, so just use its type.
257 */
258 ReturnDesc = AcpiUtCreateInternalObject (Operand[0]->Common.Type);
258 ReturnDesc = AcpiUtCreateInternalObject (ACPI_GET_OBJECT_TYPE (Operand[0]));
259 if (!ReturnDesc)
260 {
261 Status = AE_NO_MEMORY;
262 goto Cleanup;
263 }
264
265 /* Get the Integer values from the objects */
266
259 if (!ReturnDesc)
260 {
261 Status = AE_NO_MEMORY;
262 goto Cleanup;
263 }
264
265 /* Get the Integer values from the objects */
266
267 Index = (UINT32) Operand[1]->Integer.Value;
268 Length = (UINT32) Operand[2]->Integer.Value;
267 Index = (NATIVE_UINT) Operand[1]->Integer.Value;
268 Length = (ACPI_SIZE) Operand[2]->Integer.Value;
269
270 /*
271 * If the index is beyond the length of the String/Buffer, or if the
272 * requested length is zero, return a zero-length String/Buffer
273 */
274 if ((Index < Operand[0]->String.Length) &&
275 (Length > 0))
276 {
277 /* Truncate request if larger than the actual String/Buffer */
278
279 if ((Index + Length) >
280 Operand[0]->String.Length)
281 {
269
270 /*
271 * If the index is beyond the length of the String/Buffer, or if the
272 * requested length is zero, return a zero-length String/Buffer
273 */
274 if ((Index < Operand[0]->String.Length) &&
275 (Length > 0))
276 {
277 /* Truncate request if larger than the actual String/Buffer */
278
279 if ((Index + Length) >
280 Operand[0]->String.Length)
281 {
282 Length = Operand[0]->String.Length - Index;
282 Length = (ACPI_SIZE) Operand[0]->String.Length - Index;
283 }
284
285 /* Allocate a new buffer for the String/Buffer */
286
283 }
284
285 /* Allocate a new buffer for the String/Buffer */
286
287 Buffer = ACPI_MEM_CALLOCATE (Length + 1);
287 Buffer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) Length + 1);
288 if (!Buffer)
289 {
290 Status = AE_NO_MEMORY;
291 goto Cleanup;
292 }
293
294 /* Copy the portion requested */
295
296 ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index,
297 Length);
298
299 /* Set the length of the new String/Buffer */
300
301 ReturnDesc->String.Pointer = Buffer;
288 if (!Buffer)
289 {
290 Status = AE_NO_MEMORY;
291 goto Cleanup;
292 }
293
294 /* Copy the portion requested */
295
296 ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index,
297 Length);
298
299 /* Set the length of the new String/Buffer */
300
301 ReturnDesc->String.Pointer = Buffer;
302 ReturnDesc->String.Length = Length;
302 ReturnDesc->String.Length = (UINT32) Length;
303 }
304 break;
305
306
307 default:
308
309 ACPI_REPORT_ERROR (("AcpiExOpcode_3A_0T_0R: Unknown opcode %X\n",
310 WalkState->Opcode));

--- 24 unchanged lines hidden ---
303 }
304 break;
305
306
307 default:
308
309 ACPI_REPORT_ERROR (("AcpiExOpcode_3A_0T_0R: Unknown opcode %X\n",
310 WalkState->Opcode));

--- 24 unchanged lines hidden ---