Merge from vendor branch LIBSTDC++:
[dragonfly.git] / sys / contrib / dev / acpica / rsmemory.c
1 /*******************************************************************************
2  *
3  * Module Name: rsmem24 - Memory resource descriptors
4  *              $Revision: 22 $
5  *
6  ******************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/rsmemory.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $                                                               */
117
118 #define __RSMEMORY_C__
119
120 #include "acpi.h"
121 #include "acresrc.h"
122
123 #define _COMPONENT          ACPI_RESOURCES
124         ACPI_MODULE_NAME    ("rsmemory")
125
126
127 /*******************************************************************************
128  *
129  * FUNCTION:    AcpiRsMemory24Resource
130  *
131  * PARAMETERS:  ByteStreamBuffer        - Pointer to the resource input byte
132  *                                        stream
133  *              BytesConsumed           - Pointer to where the number of bytes
134  *                                        consumed the ByteStreamBuffer is
135  *                                        returned
136  *              OutputBuffer            - Pointer to the return data buffer
137  *              StructureSize           - Pointer to where the number of bytes
138  *                                        in the return data struct is returned
139  *
140  * RETURN:      Status
141  *
142  * DESCRIPTION: Take the resource byte stream and fill out the appropriate
143  *              structure pointed to by the OutputBuffer.  Return the
144  *              number of bytes consumed from the byte stream.
145  *
146  ******************************************************************************/
147
148 ACPI_STATUS
149 AcpiRsMemory24Resource (
150     UINT8                   *ByteStreamBuffer,
151     ACPI_SIZE               *BytesConsumed,
152     UINT8                   **OutputBuffer,
153     ACPI_SIZE               *StructureSize)
154 {
155     UINT8                   *Buffer = ByteStreamBuffer;
156     ACPI_RESOURCE           *OutputStruct = (void *) *OutputBuffer;
157     UINT16                  Temp16 = 0;
158     UINT8                   Temp8 = 0;
159     ACPI_SIZE               StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM24);
160
161
162     ACPI_FUNCTION_TRACE ("RsMemory24Resource");
163
164
165     /*
166      * Point past the Descriptor to get the number of bytes consumed
167      */
168     Buffer += 1;
169
170     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
171     Buffer += 2;
172     *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
173     OutputStruct->Id = ACPI_RSTYPE_MEM24;
174
175     /*
176      * Check Byte 3 the Read/Write bit
177      */
178     Temp8 = *Buffer;
179     Buffer += 1;
180     OutputStruct->Data.Memory24.ReadWriteAttribute = Temp8 & 0x01;
181
182     /*
183      * Get MinBaseAddress (Bytes 4-5)
184      */
185     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
186     Buffer += 2;
187     OutputStruct->Data.Memory24.MinBaseAddress = Temp16;
188
189     /*
190      * Get MaxBaseAddress (Bytes 6-7)
191      */
192     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
193     Buffer += 2;
194     OutputStruct->Data.Memory24.MaxBaseAddress = Temp16;
195
196     /*
197      * Get Alignment (Bytes 8-9)
198      */
199     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
200     Buffer += 2;
201     OutputStruct->Data.Memory24.Alignment = Temp16;
202
203     /*
204      * Get RangeLength (Bytes 10-11)
205      */
206     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
207     OutputStruct->Data.Memory24.RangeLength = Temp16;
208
209     /*
210      * Set the Length parameter
211      */
212     OutputStruct->Length = (UINT32) StructSize;
213
214     /*
215      * Return the final size of the structure
216      */
217     *StructureSize = StructSize;
218     return_ACPI_STATUS (AE_OK);
219 }
220
221
222 /*******************************************************************************
223  *
224  * FUNCTION:    AcpiRsMemory24Stream
225  *
226  * PARAMETERS:  LinkedList              - Pointer to the resource linked list
227  *              OutputBuffer            - Pointer to the user's return buffer
228  *              BytesConsumed           - Pointer to where the number of bytes
229  *                                        used in the OutputBuffer is returned
230  *
231  * RETURN:      Status
232  *
233  * DESCRIPTION: Take the linked list resource structure and fills in the
234  *              the appropriate bytes in a byte stream
235  *
236  ******************************************************************************/
237
238 ACPI_STATUS
239 AcpiRsMemory24Stream (
240     ACPI_RESOURCE           *LinkedList,
241     UINT8                   **OutputBuffer,
242     ACPI_SIZE               *BytesConsumed)
243 {
244     UINT8                   *Buffer = *OutputBuffer;
245     UINT16                  Temp16 = 0;
246     UINT8                   Temp8 = 0;
247
248
249     ACPI_FUNCTION_TRACE ("RsMemory24Stream");
250
251
252     /*
253      * The descriptor field is static
254      */
255     *Buffer = 0x81;
256     Buffer += 1;
257
258     /*
259      * The length field is static
260      */
261     Temp16 = 0x09;
262     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
263     Buffer += 2;
264
265     /*
266      * Set the Information Byte
267      */
268     Temp8 = (UINT8) (LinkedList->Data.Memory24.ReadWriteAttribute & 0x01);
269     *Buffer = Temp8;
270     Buffer += 1;
271
272     /*
273      * Set the Range minimum base address
274      */
275     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MinBaseAddress);
276     Buffer += 2;
277
278     /*
279      * Set the Range maximum base address
280      */
281     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MaxBaseAddress);
282     Buffer += 2;
283
284     /*
285      * Set the base alignment
286      */
287     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.Alignment);
288     Buffer += 2;
289
290     /*
291      * Set the range length
292      */
293     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.RangeLength);
294     Buffer += 2;
295
296     /*
297      * Return the number of bytes consumed in this operation
298      */
299     *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
300     return_ACPI_STATUS (AE_OK);
301 }
302
303
304 /*******************************************************************************
305  *
306  * FUNCTION:    AcpiRsMemory32RangeResource
307  *
308  * PARAMETERS:  ByteStreamBuffer        - Pointer to the resource input byte
309  *                                        stream
310  *              BytesConsumed           - Pointer to where the number of bytes
311  *                                        consumed the ByteStreamBuffer is
312  *                                        returned
313  *              OutputBuffer            - Pointer to the return data buffer
314  *              StructureSize           - Pointer to where the number of bytes
315  *                                        in the return data struct is returned
316  *
317  * RETURN:      Status
318  *
319  * DESCRIPTION: Take the resource byte stream and fill out the appropriate
320  *              structure pointed to by the OutputBuffer.  Return the
321  *              number of bytes consumed from the byte stream.
322  *
323  ******************************************************************************/
324
325 ACPI_STATUS
326 AcpiRsMemory32RangeResource (
327     UINT8                   *ByteStreamBuffer,
328     ACPI_SIZE               *BytesConsumed,
329     UINT8                   **OutputBuffer,
330     ACPI_SIZE               *StructureSize)
331 {
332     UINT8                   *Buffer = ByteStreamBuffer;
333     ACPI_RESOURCE           *OutputStruct = (void *) *OutputBuffer;
334     UINT16                  Temp16 = 0;
335     UINT8                   Temp8 = 0;
336     ACPI_SIZE               StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM32);
337
338
339     ACPI_FUNCTION_TRACE ("RsMemory32RangeResource");
340
341
342     /*
343      * Point past the Descriptor to get the number of bytes consumed
344      */
345     Buffer += 1;
346
347     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
348     Buffer += 2;
349     *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
350
351     OutputStruct->Id = ACPI_RSTYPE_MEM32;
352
353     /*
354      *  Point to the place in the output buffer where the data portion will
355      *  begin.
356      *  1. Set the RESOURCE_DATA * Data to point to its own address, then
357      *  2. Set the pointer to the next address.
358      *
359      *  NOTE: OutputStruct->Data is cast to UINT8, otherwise, this addition adds
360      *  4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(UINT8)
361      */
362
363     /*
364      * Check Byte 3 the Read/Write bit
365      */
366     Temp8 = *Buffer;
367     Buffer += 1;
368
369     OutputStruct->Data.Memory32.ReadWriteAttribute = Temp8 & 0x01;
370
371     /*
372      * Get MinBaseAddress (Bytes 4-7)
373      */
374     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MinBaseAddress,
375                             Buffer);
376     Buffer += 4;
377
378     /*
379      * Get MaxBaseAddress (Bytes 8-11)
380      */
381     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MaxBaseAddress,
382                             Buffer);
383     Buffer += 4;
384
385     /*
386      * Get Alignment (Bytes 12-15)
387      */
388     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.Alignment, Buffer);
389     Buffer += 4;
390
391     /*
392      * Get RangeLength (Bytes 16-19)
393      */
394     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.RangeLength, Buffer);
395
396     /*
397      * Set the Length parameter
398      */
399     OutputStruct->Length = (UINT32) StructSize;
400
401     /*
402      * Return the final size of the structure
403      */
404     *StructureSize = StructSize;
405     return_ACPI_STATUS (AE_OK);
406 }
407
408
409 /*******************************************************************************
410  *
411  * FUNCTION:    AcpiRsFixedMemory32Resource
412  *
413  * PARAMETERS:  ByteStreamBuffer        - Pointer to the resource input byte
414  *                                        stream
415  *              BytesConsumed           - Pointer to where the number of bytes
416  *                                        consumed the ByteStreamBuffer is
417  *                                        returned
418  *              OutputBuffer            - Pointer to the return data buffer
419  *              StructureSize           - Pointer to where the number of bytes
420  *                                        in the return data struct is returned
421  *
422  * RETURN:      Status
423  *
424  * DESCRIPTION: Take the resource byte stream and fill out the appropriate
425  *              structure pointed to by the OutputBuffer.  Return the
426  *              number of bytes consumed from the byte stream.
427  *
428  ******************************************************************************/
429
430 ACPI_STATUS
431 AcpiRsFixedMemory32Resource (
432     UINT8                   *ByteStreamBuffer,
433     ACPI_SIZE               *BytesConsumed,
434     UINT8                   **OutputBuffer,
435     ACPI_SIZE               *StructureSize)
436 {
437     UINT8                   *Buffer = ByteStreamBuffer;
438     ACPI_RESOURCE           *OutputStruct = (void *) *OutputBuffer;
439     UINT16                  Temp16 = 0;
440     UINT8                   Temp8 = 0;
441     ACPI_SIZE               StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEM32);
442
443
444     ACPI_FUNCTION_TRACE ("RsFixedMemory32Resource");
445
446
447     /*
448      * Point past the Descriptor to get the number of bytes consumed
449      */
450     Buffer += 1;
451     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
452
453     Buffer += 2;
454     *BytesConsumed = (ACPI_SIZE) Temp16 + 3;
455
456     OutputStruct->Id = ACPI_RSTYPE_FIXED_MEM32;
457
458     /*
459      * Check Byte 3 the Read/Write bit
460      */
461     Temp8 = *Buffer;
462     Buffer += 1;
463     OutputStruct->Data.FixedMemory32.ReadWriteAttribute = Temp8 & 0x01;
464
465     /*
466      * Get RangeBaseAddress (Bytes 4-7)
467      */
468     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeBaseAddress,
469                             Buffer);
470     Buffer += 4;
471
472     /*
473      * Get RangeLength (Bytes 8-11)
474      */
475     ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeLength,
476                             Buffer);
477
478     /*
479      * Set the Length parameter
480      */
481     OutputStruct->Length = (UINT32) StructSize;
482
483     /*
484      * Return the final size of the structure
485      */
486     *StructureSize = StructSize;
487     return_ACPI_STATUS (AE_OK);
488 }
489
490
491 /*******************************************************************************
492  *
493  * FUNCTION:    AcpiRsMemory32RangeStream
494  *
495  * PARAMETERS:  LinkedList              - Pointer to the resource linked list
496  *              OutputBuffer            - Pointer to the user's return buffer
497  *              BytesConsumed           - Pointer to where the number of bytes
498  *                                        used in the OutputBuffer is returned
499  *
500  * RETURN:      Status
501  *
502  * DESCRIPTION: Take the linked list resource structure and fills in the
503  *              the appropriate bytes in a byte stream
504  *
505  ******************************************************************************/
506
507 ACPI_STATUS
508 AcpiRsMemory32RangeStream (
509     ACPI_RESOURCE           *LinkedList,
510     UINT8                   **OutputBuffer,
511     ACPI_SIZE               *BytesConsumed)
512 {
513     UINT8                   *Buffer = *OutputBuffer;
514     UINT16                  Temp16 = 0;
515     UINT8                   Temp8 = 0;
516
517
518     ACPI_FUNCTION_TRACE ("RsMemory32RangeStream");
519
520
521     /*
522      * The descriptor field is static
523      */
524     *Buffer = 0x85;
525     Buffer += 1;
526
527     /*
528      * The length field is static
529      */
530     Temp16 = 0x11;
531
532     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
533     Buffer += 2;
534
535     /*
536      * Set the Information Byte
537      */
538     Temp8 = (UINT8) (LinkedList->Data.Memory32.ReadWriteAttribute & 0x01);
539     *Buffer = Temp8;
540     Buffer += 1;
541
542     /*
543      * Set the Range minimum base address
544      */
545     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MinBaseAddress);
546     Buffer += 4;
547
548     /*
549      * Set the Range maximum base address
550      */
551     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MaxBaseAddress);
552     Buffer += 4;
553
554     /*
555      * Set the base alignment
556      */
557     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.Alignment);
558     Buffer += 4;
559
560     /*
561      * Set the range length
562      */
563     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.RangeLength);
564     Buffer += 4;
565
566     /*
567      * Return the number of bytes consumed in this operation
568      */
569     *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
570     return_ACPI_STATUS (AE_OK);
571 }
572
573
574 /*******************************************************************************
575  *
576  * FUNCTION:    AcpiRsFixedMemory32Stream
577  *
578  * PARAMETERS:  LinkedList              - Pointer to the resource linked list
579  *              OutputBuffer            - Pointer to the user's return buffer
580  *              BytesConsumed           - Pointer to where the number of bytes
581  *                                        used in the OutputBuffer is returned
582  *
583  * RETURN:      Status
584  *
585  * DESCRIPTION: Take the linked list resource structure and fills in the
586  *              the appropriate bytes in a byte stream
587  *
588  ******************************************************************************/
589
590 ACPI_STATUS
591 AcpiRsFixedMemory32Stream (
592     ACPI_RESOURCE           *LinkedList,
593     UINT8                   **OutputBuffer,
594     ACPI_SIZE               *BytesConsumed)
595 {
596     UINT8                   *Buffer = *OutputBuffer;
597     UINT16                  Temp16 = 0;
598     UINT8                   Temp8 = 0;
599
600
601     ACPI_FUNCTION_TRACE ("RsFixedMemory32Stream");
602
603
604     /*
605      * The descriptor field is static
606      */
607     *Buffer = 0x86;
608     Buffer += 1;
609
610     /*
611      * The length field is static
612      */
613     Temp16 = 0x09;
614
615     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
616     Buffer += 2;
617
618     /*
619      * Set the Information Byte
620      */
621     Temp8 = (UINT8) (LinkedList->Data.FixedMemory32.ReadWriteAttribute & 0x01);
622     *Buffer = Temp8;
623     Buffer += 1;
624
625     /*
626      * Set the Range base address
627      */
628     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer,
629                             &LinkedList->Data.FixedMemory32.RangeBaseAddress);
630     Buffer += 4;
631
632     /*
633      * Set the range length
634      */
635     ACPI_MOVE_UNALIGNED32_TO_32 (Buffer,
636                             &LinkedList->Data.FixedMemory32.RangeLength);
637     Buffer += 4;
638
639     /*
640      * Return the number of bytes consumed in this operation
641      */
642     *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
643     return_ACPI_STATUS (AE_OK);
644 }
645