Esempio n. 1
0
	}

	rc = uefi_call_wrapper(BS->StartImage, 3, image_handle, NULL, NULL);
	if (EFI_ERROR(rc)) {
		Print(L"StartImage failed: %d\n", rc);
		uefi_call_wrapper(BS->Stall, 1, 500000000);
	}
	return rc;
}

EFI_GUID SHIM_LOCK_GUID = { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} };
extern EFI_STATUS
efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab);

static void
__attribute__((__optimize__("0")))
debug_hook(void)
{
	EFI_GUID guid = SHIM_LOCK_GUID;
	UINT8 *data = NULL;
	UINTN dataSize = 0;
	EFI_STATUS efi_status;
	volatile register int x = 0;
	extern char _etext, _edata;

	efi_status = get_variable(L"SHIM_DEBUG", &data, &dataSize, guid);
	if (EFI_ERROR(efi_status)) {
		return;
	}

	if (x)
Esempio n. 2
0
  while (c <= e) {
    munit_rand_memory(sizeof(v), (psnip_uint8_t*) &v);
    v ^= psnip_unaligned_load_uint16(c);
    psnip_unaligned_store_uint16(c, v);

    c++;
  }

  return MUNIT_OK;
}

/* Try to get the compiler to vectorize this; SIMD instructions are
   more likely to have problems with unaligned accesses. */
#if defined(__GNUC__)
#  if !defined(__clang__)
__attribute__((__optimize__(3),__noinline__))
#  else
__attribute__((__noinline__))
#  endif
#endif
static void
dangerous_copy(size_t count, psnip_uint64_t* dest, const psnip_uint64_t* src) {
  size_t i;
  for (i = 0 ; i < count ; i++) {
    psnip_unaligned_store_uint64(&(dest[i]), psnip_unaligned_load_uint64(&(src[i])));
  }
}

#if defined(__GNUC__)
#  if defined(__has_attribute) && !defined(__ibmxl__)
#    if __has_attribute(optnone)
Esempio n. 3
0
      gomp_mutex_unlock (&acc_dev->lock);

      gomp_mutex_unlock (&acc_device_lock);

      goacc_attach_host_thread_to_device (ord);
    }
  
  goacc_device_num = ord;
}

ialias (acc_set_device_num)

/* Compile on_device with optimization, so that the compiler expands
   this, rather than generating infinitely recursive code.  */

int __attribute__ ((__optimize__ ("O2")))
acc_on_device (acc_device_t dev)
{
  return __builtin_acc_on_device (dev);
}

ialias (acc_on_device)

attribute_hidden void
goacc_runtime_initialize (void)
{
  gomp_mutex_init (&acc_device_lock);

#if !(defined HAVE_TLS || defined USE_EMUTLS)
  pthread_key_create (&goacc_tls_key, NULL);
#endif
Esempio n. 4
0
		}
#endif

}

// UART1 functions
#if (ENABLE_UART1 == TRUE)

#if !__GNUC__
#if (NESTING_INT == 1)
#pragma TRAP_PROC
#else
interrupt
#endif
#else
__attribute__ ((__optimize__("omit-frame-pointer")))
#endif
void uart1_tx(void)
{
    // ************************
    // Interrupt Entry
    // ************************
#if __GNUC__
	OS_SAVE_ISR();
#endif

	OS_INT_ENTER();

	// Tratamento da interrupção
#if __GNUC__
	BITCLEARMASK(SCI1C2,SCI1C2_TCIE_MASK);
Esempio n. 5
0
#include <unistd.h>

__attribute__((__optimize__("-fno-tree-loop-distribute-patterns")))
size_t (libc_strlen)(const char* _String)
{
    const char* eos = _String;

    while (*eos != '\0')
    {
        ++eos;
    }

    return eos - _String;
}

__attribute__((__optimize__("-fno-tree-loop-distribute-patterns")))
void*
(libc_memcpy)(
    void* restrict _Destination,
    const void* restrict _Source,
    size_t _Size
)
{
    unsigned char* destination = (unsigned char*)_Destination;
    const unsigned char* source = (const unsigned char*)_Source;

    while (_Size--)
    {
        (*destination) = (*source);
        ++destination;
        ++source;
Esempio n. 6
0
        // for boost::result_of
        typedef weighted_sample result_type;

        template<typename Args>
        weighted_sum_kahan_impl(Args const &args)
          : weighted_sum_(
                args[parameter::keyword<Tag>::get() | Sample()] * numeric::one<Weight>::value),
                compensation(boost::numeric_cast<weighted_sample>(0.0))
        {
        }

        template<typename Args>
        void 
#if BOOST_ACCUMULATORS_GCC_VERSION > 40305
        __attribute__((__optimize__("no-associative-math")))
#endif
        operator ()(Args const &args)
        {
            const weighted_sample myTmp1 = args[parameter::keyword<Tag>::get()] * args[weight] - this->compensation;
            const weighted_sample myTmp2 = this->weighted_sum_ + myTmp1;
            this->compensation = (myTmp2 - this->weighted_sum_) - myTmp1;
            this->weighted_sum_ = myTmp2;

        }

        result_type result(dont_care) const
        {
            return this->weighted_sum_;
        }