summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halvict/ppc/pxpcisup.c
blob: 14cb7ba41eda7fb6ab023578f48afd4d87f2851a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708


/*++

Copyright (c) 1990  Microsoft Corporation

Copyright (c) 1994 MOTOROLA, INC.  All Rights Reserved.  This file
contains copyrighted material.  Use of this file is restricted
by the provisions of a Motorola Software License Agreement.

Module Name:

    pxmemctl.c

Abstract:

    The module initializes any planar registers.
    This module also implements machince check parity error handling.

Author:

    Jim Wooldridge (jimw@austin.vnet.ibm.com)


Revision History:

    Jake Oshins
        Support Victory machines
    Peter Johnston
        Merge Victory/Doral versions.


--*/

#include "halp.h"
#include "pci.h"
#include "pcip.h"
#include "pxmpic2.h"
#include "ibmppc.h"

#define IsPciBridge(a)  \
            (a->VendorID != PCI_INVALID_VENDORID    &&  \
             PCI_CONFIG_TYPE(a) == PCI_BRIDGE_TYPE  &&  \
             a->SubClass == 4 && a->BaseClass == 6)

//
// UNION has two top level PCI busses.
//

#define UNION_PCI_BASE_0      0xbfff8000
#define UNION_PCI_BASE_1      0xbfef8000

PVOID HalpPciConfigAddr[2];
PVOID HalpPciConfigData[2];
UCHAR HalpEpciMin = 0xff;
UCHAR HalpEpciMax = 0xff;

ULONG HalpPciMaxSlots = PCI_MAX_DEVICES;

typedef struct _PCI_BUS_NODE {
    struct _PCI_BUS_NODE *Sibling;
    struct _PCI_BUS_NODE *Child;
    ULONG BusNumber;   // logical bus number
    ULONG BaseBus;     // number of the root bus
    ULONG BaseSlot;    // slot in the base bus that these PPBs are plugged into
} PCI_BUS_NODE, *PPCI_BUS_NODE;

PPCI_BUS_NODE HalpPciBusTree = NULL;

UCHAR
HalpSearchPciBridgeMap(
    IN PPCI_BUS_NODE Node,
    IN ULONG BusNumber,
    IN PCI_SLOT_NUMBER PciSlot,
    IN UCHAR InterruptPin
    );

VOID
HalpInitializePciAccess (
    VOID
    );

ULONG
HalpPhase0SetPciDataByOffset (
    ULONG BusNumber,
    ULONG SlotNumber,
    PVOID Buffer,
    ULONG Offset,
    ULONG Length
    );

ULONG
HalpPhase0GetPciDataByOffset (
    ULONG BusNumber,
    ULONG SlotNumber,
    PVOID Buffer,
    ULONG Offset,
    ULONG Length
    );

#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE,HalpGetPCIIrq)
#pragma alloc_text(INIT,HalpInitializePciAccess)
#pragma alloc_text(INIT,HalpPhase0GetPciDataByOffset)
#pragma alloc_text(INIT,HalpPhase0SetPciDataByOffset)
#pragma alloc_text(PAGE,HalpSearchPciBridgeMap)
#endif




VOID
HalpInitializePciAccess (
    VOID
    )
/*++

Routine Description:

    Fill the HalpPciConfigAddr and HalpPciConfigData arrays with
    virtual addresses used to access the various top level PCI
    busses on this machine.

Arguments:

    None.

Return Value:

    None.

--*/

{
    if ( HalpSystemType != IBM_DORAL ) {
        HalpPciConfigAddr[0] = (PVOID)((ULONG)HalpIoControlBase + 0xcf8);
        HalpPciConfigData[0] = (PVOID)((ULONG)HalpIoControlBase + 0xcfc);

        return;
    }

    //
    // UNION based systems (eg Doral)
    //

    HalpPciConfigAddr[0] = HalpAssignReservedVirtualSpace(
                               UNION_PCI_BASE_0 >> PAGE_SHIFT,
                               2);
    HalpPciConfigData[0] = (PVOID)((ULONG)HalpPciConfigAddr[0] + 0x10);

    HalpPciConfigAddr[1] = HalpAssignReservedVirtualSpace(
                               UNION_PCI_BASE_1 >> PAGE_SHIFT,
                               2);
    HalpPciConfigData[1] = (PVOID)((ULONG)HalpPciConfigAddr[1] + 0x10);

    if ( !HalpPciConfigAddr[0] ||
         !HalpPciConfigAddr[1] ) {
        KeBugCheck(HAL_INITIALIZATION_FAILED);
    }

#define EPCI_KLUDGE
#if defined(EPCI_KLUDGE)
#define IBMHOSTPCIBRIDGE 0x003a1014
    //
    // The EPCI bus on doral is initialized with a bus number of 0x80
    // for reasons unclear.   Reset it so it is the next logical bus
    // following the max PCI bus.
    //
    // The following code is really grungy, we should use PCI
    // access routines to do it,.... the gist of it is
    //
    // (1) Check that we have an IBM Host/PCI bridge.
    // (2) Check that it thinks it's bus 80 and subordinate
    //     bus 80 also (ie no subordinate busses).
    // (3) Change to bus 0 subordinate bus 0.
    //

    {
        ULONG BusInfo;
        PULONG PciAddr = (PULONG)(HalpPciConfigAddr[0]);
        PULONG PciData = (PULONG)(HalpPciConfigData[0]);
        PULONG EpciAddr = (PULONG)(HalpPciConfigAddr[1]);
        PULONG EpciData = (PULONG)(HalpPciConfigData[1]);
        ULONG BusNo;
        ULONG Found = 0;

        //
        // First, locate the host bridge on the PCI bus.  Hopefully
        // it's on bus 0.
        //

        *PciAddr = 0x80000000;
        __builtin_eieio();
        BusInfo = *PciData;

        if ( BusInfo == IBMHOSTPCIBRIDGE ) {
            //
            // Have bridge, see what the bus range is.
            //
            *PciAddr = 0x80000040;
            __builtin_eieio();
            BusInfo = *PciData;
            HalpEpciMin = (UCHAR)(((BusInfo >> 8) & 0xff) + 1);
            //
            // Now, find bridge on EPCI bus.  Scan for it.
            //
            for ( BusNo = 0 ; BusNo < 0x100 ; BusNo++ ) {
                *EpciAddr = 0x80000000 | (BusNo << 16);
                __builtin_eieio();
                BusInfo = *EpciData;
                if ( BusInfo == IBMHOSTPCIBRIDGE ) {
                    *EpciAddr = 0x80000000 | (BusNo << 16) | 0x40;
                    __builtin_eieio();
                    BusInfo = *EpciData;

                    // Subordinate bus number - Primary bus number
                    HalpEpciMax = (UCHAR)(((BusInfo >> 8) & 0xff) - (BusInfo & 0xff));
                    HalpEpciMax += HalpEpciMin;

                    BusInfo &= 0xffff0000;
                    BusInfo |= (HalpEpciMax << 8) | HalpEpciMin;
                    *EpciData = BusInfo;
                    Found = 1;
                    break;
                }
            }
            if ( !Found ) {
                //
                // No bridge on EPCI bus?
                //
                HalpEpciMin = HalpEpciMax = 0xff;
            }
        }
    }

#endif

#define AMD_KLUDGE
#if defined(AMD_KLUDGE)
#define AMDPCIETHERNET 0x20001022
    //
    // Open firmware is configuring the AMD chip in a way we cannot
    // deal with.  It is possible to issue a hard reset on Doral/Terlingua
    // so that's what we do here.
    //

    {
        PULONG PciAddr = (PULONG)(HalpPciConfigAddr[0]);
        PULONG PciData = (PULONG)(HalpPciConfigData[0]);
        PVOID CRRBase;
        ULONG CfgSpace[16];
        ULONG Slot;
        ULONG i;

        for ( Slot = 0 ; Slot < 32 ; Slot++ ) {
            HalpPhase0GetPciDataByOffset(0,
                                         Slot,
                                         CfgSpace,
                                         0,
                                         64);
            if ( CfgSpace[0] == AMDPCIETHERNET ) {
                //
                // Change the command (and status) of this puppy
                // so that when we write it back it's disabled.
                //
                CfgSpace[1] = 0;

                //
                // Ok, now we need to write to UNION's Component
                // Reset Register for this bridge.  Bits of interest
                // are 0 thru 5 correcponding to devices 1 thru 6
                // (spec says 0 thru 5 but they seem to want you
                // to skip the memory controller before you start
                // counting).
                //
                // Also, this register isn't byte reversed so we hit
                // bits 24 thru 31 instead,...  note that setting to
                // 1 means leave it alone, setting to 0 resets.
                //
                // This register is at xxxf7ef0 which isn't mapped.
                // This is the PCI bridge (not EPCI) so xxx in this
                // case is bff.
                //
                CRRBase = HalpAssignReservedVirtualSpace(0xbfff7, 1);

                if ( !CRRBase ) {
                    //
                    // Bad things happened, give up.
                    //
                    break;
                }

                *(PULONG)((ULONG)CRRBase + 0xef0) = 0xfc ^ (0x80 >> (Slot - 1));
                //
                // Wait a while then unset the reset bit.
                //
                for ( i = 0 ; i < 1000000 ; i++ ) {
                    __builtin_eieio();
                }
                *(PULONG)((ULONG)CRRBase + 0xef0) = 0xfc;
                //
                // Wait a while longer then write back the config space.
                //
                for ( i = 0 ; i < 1000000 ; i++ ) {
                    __builtin_eieio();
                }
                HalpReleaseReservedVirtualSpace(CRRBase, 1);
                HalpPhase0SetPciDataByOffset(0,
                                             Slot,
                                             CfgSpace,
                                             0,
                                             64);
                //
                // Assume there's only one.
                //
                break;
            }
        }
    }

#endif


}

ULONG
HalpTranslatePciSlotNumber (
    ULONG BusNumber,
    ULONG SlotNumber
    )
/*++

Routine Description:

    This routine translate a PCI slot number to a PCI device number.

Arguments:

    None.

Return Value:

    Returns length of data written.

--*/

{
   //
   // Sandalfoot only has 1 PCI bus so bus number is unused
   //

   PCI_TYPE1_CFG_BITS PciConfig;
   PCI_SLOT_NUMBER    PciSlotNumber;

   PciSlotNumber.u.AsULONG = SlotNumber;

   PciConfig.u.AsULONG = 0;
   PciConfig.u.bits.DeviceNumber = PciSlotNumber.u.bits.DeviceNumber;
   PciConfig.u.bits.FunctionNumber = PciSlotNumber.u.bits.FunctionNumber;
   PciConfig.u.bits.BusNumber = BusNumber;
   PciConfig.u.bits.Enable = TRUE;

   return (PciConfig.u.AsULONG);
}

ULONG
HalpPhase0SetPciDataByOffset (
    ULONG BusNumber,
    ULONG SlotNumber,
    PVOID Buffer,
    ULONG Offset,
    ULONG Length
    )

/*++

Routine Description:

    This routine writes to PCI configuration space prior to bus handler
    installation.

Arguments:

    BusNumber   PCI Bus Number.  This is the 8 bit BUS Number which is
                bits 23-16 of the Configuration Address.  In support of
                multiple top level busses, the upper 24 bits of this
                argument will supply the index into the table of
                configuration address registers.
    SlotNumber  PCI Slot Number, 8 bits composed of the 5 bit device
                number (bits 15-11 of the configuration address) and
                the 3 bit function number (10-8).
    Buffer      Address of source data.
    Offset      Number of bytes to skip from base of PCI config area.
    Length      Number of bytes to write

Return Value:

    Returns length of data written.

--*/

{
    PCI_TYPE1_CFG_BITS ConfigAddress;
    ULONG ReturnLength;
    PVOID ConfigAddressRegister;
    PVOID ConfigDataRegister;
    PUCHAR Bfr = (PUCHAR)Buffer;

    if ( BusNumber < HalpEpciMin ) {
        ConfigAddressRegister = HalpPciConfigAddr[0];
        ConfigDataRegister    = HalpPciConfigData[0];
    } else {
        ConfigAddressRegister = HalpPciConfigAddr[1];
        ConfigDataRegister    = HalpPciConfigData[1];
    }

    ASSERT(!(Offset & ~0xff));
    ASSERT(Length);
    ASSERT((Offset + Length) <= 256);

    if ( Length + Offset > 256 ) {
        if ( Offset > 256 ) {
            return 0;
        }
        Length = 256 - Offset;
    }

    ReturnLength = Length;

    ConfigAddress.u.AsULONG = HalpTranslatePciSlotNumber(BusNumber,
                                                         SlotNumber);
    ConfigAddress.u.bits.RegisterNumber = (Offset & 0xfc) >> 2;

    if ( Offset & 0x3 ) {
        //
        // Access begins at a non-register boundary in the config
        // space.  We need to read the register containing the data
        // and rewrite only the changed data.   (I wonder if this
        // ever really happens?)
        //
        ULONG SubOffset = Offset & 0x3;
        ULONG SubLength = 4 - SubOffset;
        union {
            ULONG All;
            UCHAR Bytes[4];
        } Tmp;

        if ( SubLength > Length ) {
            SubLength = Length;
        }

        //
        // Adjust Length (remaining) and (new) Offset bu amount covered
        // in this first word.
        //
        Length -= SubLength;
        Offset += SubLength;

        //
        // Get the first word (register), replace only those bytes that
        // need to be changed, then write the whole thing back out again.
        //
        WRITE_PORT_ULONG(ConfigAddressRegister, ConfigAddress.u.AsULONG);
        Tmp.All = READ_PORT_ULONG(ConfigDataRegister);

        while ( SubLength-- ) {
            Tmp.Bytes[SubOffset++] = *Bfr++;
        }

        WRITE_PORT_ULONG(ConfigDataRegister, Tmp.All);

        //
        // Aim ConfigAddressRegister at the next word (register).
        //
        ConfigAddress.u.bits.RegisterNumber++;
    }

    //
    // Do the majority of the transfer 4 bytes at a time.
    //
    while ( Length > sizeof(ULONG) ) {
        ULONG Tmp = *(UNALIGNED PULONG)Bfr;
        WRITE_PORT_ULONG(ConfigAddressRegister, ConfigAddress.u.AsULONG);
        WRITE_PORT_ULONG(ConfigDataRegister, Tmp);
        ConfigAddress.u.bits.RegisterNumber++;
        Bfr += sizeof(ULONG);
        Length -= sizeof(ULONG);

    }

    //
    // Do bytes in last register.
    //
    if ( Length ) {
        union {
            ULONG All;
            UCHAR Bytes[4];
        } Tmp;
        ULONG i = 0;
        WRITE_PORT_ULONG(ConfigAddressRegister, ConfigAddress.u.AsULONG);
        Tmp.All = READ_PORT_ULONG(ConfigDataRegister);

        while ( Length-- ) {
            Tmp.Bytes[i++] = *(PUCHAR)Bfr++;
        }
        WRITE_PORT_ULONG(ConfigDataRegister, Tmp.All);
    }

    return ReturnLength;
}

ULONG
HalpPhase0GetPciDataByOffset (
    ULONG BusNumber,
    ULONG SlotNumber,
    PVOID Buffer,
    ULONG Offset,
    ULONG Length
    )

/*++

Routine Description:

    This routine reads PCI config space prior to bus handlder installation.

Arguments:

    BusNumber   PCI Bus Number.  This is the 8 bit BUS Number which is
                bits 23-16 of the Configuration Address.  In support of
                multiple top level busses, the upper 24 bits of this
                argument will supply the index into the table of
                configuration address registers.
    SlotNumber  PCI Slot Number, 8 bits composed of the 5 bit device
                number (bits 15-11 of the configuration address) and
                the 3 bit function number (10-8).
    Buffer      Address of source data.
    Offset      Number of bytes to skip from base of PCI config area.
    Length      Number of bytes to write

Return Value:

    Amount of data read.

--*/

{
    PCI_TYPE1_CFG_BITS ConfigAddress;
    PCI_TYPE1_CFG_BITS ConfigAddressTemp;
    ULONG ReturnLength;
    ULONG i;
    union {
        ULONG All;
        UCHAR Bytes[4];
    } Tmp;
    PVOID ConfigAddressRegister;
    PVOID ConfigDataRegister;

    if ( BusNumber < HalpEpciMin ) {
        ConfigAddressRegister = HalpPciConfigAddr[0];
        ConfigDataRegister    = HalpPciConfigData[0];
    } else {
        ConfigAddressRegister = HalpPciConfigAddr[1];
        ConfigDataRegister    = HalpPciConfigData[1];
    }

    ASSERT(!(Offset & ~0xff));
    ASSERT(Length);
    ASSERT((Offset + Length) <= 256);

    if ( Length + Offset > 256 ) {
        if ( Offset > 256 ) {
            return 0;
        }
        Length = 256 - Offset;
    }

    ReturnLength = Length;

    ConfigAddress.u.AsULONG = HalpTranslatePciSlotNumber(BusNumber,
                                                         SlotNumber);
    ConfigAddress.u.bits.RegisterNumber = (Offset & 0xfc) >> 2;

    //
    // If we are being asked to read data when function != 0, check
    // first to see if this device decares itself as a multi-function
    // device.  If it doesn't, don't do this read.
    //
    if (ConfigAddress.u.bits.FunctionNumber != 0) {

        ConfigAddressTemp.u.bits.RegisterNumber = 3; // contains header type
        ConfigAddressTemp.u.bits.FunctionNumber = 0; // look at base package
        ConfigAddressTemp.u.bits.DeviceNumber = ConfigAddress.u.bits.DeviceNumber;
        ConfigAddressTemp.u.bits.BusNumber    = ConfigAddress.u.bits.BusNumber;
        ConfigAddressTemp.u.bits.Enable       = TRUE;

        WRITE_PORT_ULONG(ConfigAddressRegister, ConfigAddressTemp.u.AsULONG);
        Tmp.All = READ_PORT_ULONG(ConfigDataRegister);

        if (!(Tmp.Bytes[2] & 0x80)) { // if the Header type field's multi-function bit is not set

            for (i = 0; i < Length; i++) {
                *((PUCHAR)Buffer)++ = 0xff; // Make this read as if the device isn't populated
            }

            return Length;
        }
    }

    i = Offset & 0x3;

    while ( Length ) {
        WRITE_PORT_ULONG(ConfigAddressRegister, ConfigAddress.u.AsULONG);
        Tmp.All = READ_PORT_ULONG(ConfigDataRegister);
        while ( (i < 4) && Length) {
            *((PUCHAR)Buffer)++ = Tmp.Bytes[i];
            i++;
            Length--;
        }
        i = 0;
        ConfigAddress.u.bits.RegisterNumber++;
    }
    return ReturnLength;
}

NTSTATUS
HalpGetPCIIrq (
    IN PBUS_HANDLER     BusHandler,
    IN PBUS_HANDLER     RootHandler,
    IN PCI_SLOT_NUMBER  PciSlot,
    OUT PSUPPORTED_RANGE    *Interrupt
    )
{
    UCHAR                   buffer[PCI_COMMON_HDR_LENGTH];
    PPCI_COMMON_CONFIG      PciData;
    UCHAR                   InterruptPin;
    UCHAR                   BaseLimit = 0;
    UCHAR                   Class;

    PciData = (PPCI_COMMON_CONFIG) buffer;
    HalGetBusData (
        PCIConfiguration,
        BusHandler->BusNumber,
        PciSlot.u.AsULONG,
        PciData,
        PCI_COMMON_HDR_LENGTH
        );

    if (PciData->VendorID == PCI_INVALID_VENDORID  ||
        PCI_CONFIG_TYPE (PciData) != 0) {
        return STATUS_UNSUCCESSFUL;
    }

    *Interrupt = ExAllocatePool (PagedPool, sizeof (SUPPORTED_RANGE));
    if (!*Interrupt) {
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    RtlZeroMemory (*Interrupt, sizeof (SUPPORTED_RANGE));

    InterruptPin = PciData->u.type0.InterruptPin;
    Class = PciData->BaseClass;

    if (InterruptPin == 0) {    // Device doesn't implement an interrupt
        return STATUS_UNSUCCESSFUL;
    }

    BaseLimit = PciData->u.type0.InterruptLine + MPIC_BASE_VECTOR;

    (*Interrupt)->Base  = BaseLimit;
    (*Interrupt)->Limit = BaseLimit;

#if DBG
    DbgPrint("Interrupt line, by the hardware: 0x%x\n",
             PciData->u.type0.InterruptLine + MPIC_BASE_VECTOR);
#endif

    if ( BaseLimit != NOT_MPIC) {

#if defined(SOFT_HDD_LAMP)

        if ( Class == 1 ) {
            //
            // This device is a Mass Storage Controller, set flag to
            // turn on the HDD Lamp when interrupts come in on this
            // vector.
            //
            // (Shouldn't there be a constant defined somewhere for
            // the Class?  (plj)).
            //

            extern ULONG HalpMassStorageControllerVectors;

            HalpMassStorageControllerVectors |= 1 << BaseLimit;
        }

#endif

        return STATUS_SUCCESS;
    }

    ASSERT(!(BaseLimit == NOT_MPIC));  // We should never hit this because
                                       // there should never be a device
                                       // with an interrupt pin != 0 that
                                       // has no valid mapping to the MPIC
    return STATUS_UNSUCCESSFUL;
}