@@ -132,13 +132,6 @@ static long max_stack_depth_bytes = 100 * 1024L;
132
132
*/
133
133
static char * stack_base_ptr = NULL ;
134
134
135
- /*
136
- * On IA64 we also have to remember the register stack base.
137
- */
138
- #if defined(__ia64__ ) || defined(__ia64 )
139
- static char * register_stack_base_ptr = NULL ;
140
- #endif
141
-
142
135
/*
143
136
* Flag to keep track of whether we have started a transaction.
144
137
* For extended query protocol this has to be remembered across messages.
@@ -3392,41 +3385,6 @@ ProcessInterrupts(void)
3392
3385
ProcessLogMemoryContextInterrupt ();
3393
3386
}
3394
3387
3395
-
3396
- /*
3397
- * IA64-specific code to fetch the AR.BSP register for stack depth checks.
3398
- *
3399
- * We currently support gcc and icc here.
3400
- *
3401
- * Note: while icc accepts gcc asm blocks on x86[_64], this is not true on
3402
- * ia64 (at least not in icc versions before 12.x). So we have to carry a
3403
- * separate implementation for it.
3404
- */
3405
- #if defined(__ia64__ ) || defined(__ia64 )
3406
-
3407
- #if defined(__INTEL_COMPILER )
3408
- /* icc */
3409
- #include <asm/ia64regs.h>
3410
- #define ia64_get_bsp () ((char *) __getReg(_IA64_REG_AR_BSP))
3411
- #else
3412
- /* gcc */
3413
- static __inline__ char *
3414
- ia64_get_bsp (void )
3415
- {
3416
- char * ret ;
3417
-
3418
- /* the ;; is a "stop", seems to be required before fetching BSP */
3419
- __asm__ __volatile__(
3420
- ";;\n"
3421
- " mov %0=ar.bsp \n"
3422
- : "=r" (ret ));
3423
-
3424
- return ret ;
3425
- }
3426
- #endif
3427
- #endif /* IA64 */
3428
-
3429
-
3430
3388
/*
3431
3389
* set_stack_base: set up reference point for stack depth checking
3432
3390
*
@@ -3440,12 +3398,7 @@ set_stack_base(void)
3440
3398
#endif
3441
3399
pg_stack_base_t old ;
3442
3400
3443
- #if defined(__ia64__ ) || defined(__ia64 )
3444
- old .stack_base_ptr = stack_base_ptr ;
3445
- old .register_stack_base_ptr = register_stack_base_ptr ;
3446
- #else
3447
3401
old = stack_base_ptr ;
3448
- #endif
3449
3402
3450
3403
/*
3451
3404
* Set up reference point for stack depth checking. On recent gcc we use
@@ -3457,9 +3410,6 @@ set_stack_base(void)
3457
3410
#else
3458
3411
stack_base_ptr = & stack_base ;
3459
3412
#endif
3460
- #if defined(__ia64__ ) || defined(__ia64 )
3461
- register_stack_base_ptr = ia64_get_bsp ();
3462
- #endif
3463
3413
3464
3414
return old ;
3465
3415
}
@@ -3476,12 +3426,7 @@ set_stack_base(void)
3476
3426
void
3477
3427
restore_stack_base (pg_stack_base_t base )
3478
3428
{
3479
- #if defined(__ia64__ ) || defined(__ia64 )
3480
- stack_base_ptr = base .stack_base_ptr ;
3481
- register_stack_base_ptr = base .register_stack_base_ptr ;
3482
- #else
3483
3429
stack_base_ptr = base ;
3484
- #endif
3485
3430
}
3486
3431
3487
3432
/*
@@ -3538,22 +3483,6 @@ stack_is_too_deep(void)
3538
3483
stack_base_ptr != NULL )
3539
3484
return true;
3540
3485
3541
- /*
3542
- * On IA64 there is a separate "register" stack that requires its own
3543
- * independent check. For this, we have to measure the change in the
3544
- * "BSP" pointer from PostgresMain to here. Logic is just as above,
3545
- * except that we know IA64's register stack grows up.
3546
- *
3547
- * Note we assume that the same max_stack_depth applies to both stacks.
3548
- */
3549
- #if defined(__ia64__ ) || defined(__ia64 )
3550
- stack_depth = (long ) (ia64_get_bsp () - register_stack_base_ptr );
3551
-
3552
- if (stack_depth > max_stack_depth_bytes &&
3553
- register_stack_base_ptr != NULL )
3554
- return true;
3555
- #endif /* IA64 */
3556
-
3557
3486
return false;
3558
3487
}
3559
3488
0 commit comments