Ejemplo n.º 1
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init();
  codeCache_init();
  VM_Version_init();
  os_init_globals();
  stubRoutines_init1();
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1
  if (status != JNI_OK)
    return status;

  interpreter_init();  // before any methods loaded
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#ifndef VM_STRUCTS_KERNEL
  vmStructs_init();
#endif // VM_STRUCTS_KERNEL

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // Although we'd like to, we can't easily do a heap verify
  // here because the main thread isn't yet a JavaThread, so
  // its TLAB may not be made parseable from the usual interfaces.
  if (VerifyBeforeGC && !UseTLAB &&
      Universe::heap()->total_collections() >= VerifyGCStartAt) {
    Universe::heap()->prepare_for_verify();
    Universe::verify();   // make sure we're starting with a clean slate
  }

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}
Ejemplo n.º 2
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init();
  codeCache_init();
  VM_Version_init();
  os_init_globals();
  stubRoutines_init1();
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1 and metaspace_init.
  if (status != JNI_OK)
    return status;

  interpreter_init();  // before any methods loaded
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#if INCLUDE_VM_STRUCTS
  vmStructs_init();
#endif // INCLUDE_VM_STRUCTS

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}
Ejemplo n.º 3
0
jint init_globals() {
  HandleMark hm;
  management_init();
  bytecodes_init();
  classLoader_init1();
  compilationPolicy_init();
  codeCache_init();
  CodeCacheExtensions::initialize();
  VM_Version_init();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::VMVersion);
  os_init_globals();
  stubRoutines_init1();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::StubRoutines1);
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1 and metaspace_init.
  if (status != JNI_OK)
    return status;

  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Universe);
  interpreter_init();  // before any methods loaded
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Interpreter);
  invocationCounter_init();  // before any methods loaded
  marksweep_init();
  accessFlags_init();
  templateTable_init();
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  referenceProcessor_init();
  jni_handles_init();
#if INCLUDE_VM_STRUCTS
  vmStructs_init();
#endif // INCLUDE_VM_STRUCTS

  vtableStubs_init();
  InlineCacheBuffer_init();
  compilerOracle_init();
  dependencyContext_init();

  if (!compileBroker_init()) {
    return JNI_EINVAL;
  }
  VMRegImpl::set_regName();

  if (!universe_post_init()) {
    return JNI_ERR;
  }
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init
  MethodHandles::generate_adapters();
  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::StubRoutines2);

#if INCLUDE_NMT
  // Solaris stack is walkable only after stubRoutines are set up.
  // On Other platforms, the stack is always walkable.
  NMT_stack_walkable = true;
#endif // INCLUDE_NMT

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal || PrintFlagsRanges) {
    CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
  }

  CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::InitGlobals);
  return JNI_OK;
}
Ejemplo n.º 4
0
Archivo: main.c Proyecto: gkolotelo/670
int peripheralInit()
{
	buzzer_init();
	ledswi_initLedSwitch(1,3);
	display_7segments_initDisplays();
	lcd_initLcd();
	cooler_initForPwm();
	heater_initForPwm();
	adc_initAdc();
	tach_init();

	SIM_BASE_PTR->SCGC5 |= SIM_SCGC5_PORTB_MASK;
	PORTB_BASE_PTR->PCR[18] = PORTB_BASE_PTR->PCR[19] = PORT_PCR_MUX(3);
	PTB_BASE_PTR->PDDR = 0b11 << 19;
	tpm_config_t tpmConfig =
	{
			.eClock_source = McgPllFllClk,
			.uiPeriod_us = 1000,
			.ePrescaler_value = Prescaler128,
			.uiXtal_frequency = 40000000,
			.eAlignment = Edge
	};
	/* Configure for 50% Duty Cycle */
	channel_config_t channelConfig_cooler =
	{
			.eChannelOutput = NoInversion,
			.uiChannel = 1,
			.uiInterrupt_enable = 0,
			.uiPulse_width_us = 500
	};

	pwm_initPwm(TPM1, tpmConfig);
	pwm_channelInit (TPM1, tpmConfig, channelConfig_cooler);

	interpreter_init();

	tc_installLptmr0(CYCLIC_EXECUTIVE_PERIOD, main_cyclicExecuteIsr);
}

int main(void)
{
    boardInit();
    peripheralInit();
    /* Set Red LED for Status */
    SIM_SCGC5 |= (SIM_SCGC5_PORTB_MASK);
    PORTB_PCR18 = PORT_PCR_MUX(1);
    PTB_BASE_PTR->PDDR = 1 << 18;



    /* Local variables */
    char cTachReadout[15];
    uint16_t uiTachValue;

    /* Main loop */
    for (;;) {
    	/* Blink Red LED for Status */
    	PTB_BASE_PTR->PTOR = 1 << 18;

    	/* Serial CLI */
    	interpreter_readCommand();

    	/* Get temperature */
    	PRINTF("%d\r\n", adc_getValue());

    	/* Read and print tach value */
    	uiTachValue = tach_Hz(CYCLIC_EXECUTIVE_PERIOD/1000);
    	lcd_itoa(uiTachValue, cTachReadout);
    	lcd_clearLine(0);
    	lcd_writeString(cTachReadout);
    	lcd_writeString(" Hz");

    	/* Wait for next cycle */
    	while(!uiFlagNextPeriod);
    	uiFlagNextPeriod = 0;


    }

    return 0;
}
Ejemplo n.º 5
0
jint init_globals() {

  HandleMark hm;
  // 初始化各子系统的监控及管理服务
  // JMX、线程和同步子系统、类加载子系统的监控和管理
  management_init();
  // 初始化字节码表,如istore、iload、iadd
  bytecodes_init();
  // 类加载器初始化
  classLoader_init();
  // 代码缓存池初始化
  codeCache_init();
  // VM版本初始化
  VM_Version_init();
  // 系统初始化
  os_init_globals();
  stubRoutines_init1();
  // ============================
  // 初始化堆以及决定所使用GC策略
  // ============================
  jint status = universe_init();  // dependent on codeCache_init and
                                  // stubRoutines_init1
  if (status != JNI_OK)
    return status;
  // 初始化解析器
  interpreter_init();  // before any methods loaded
  // 初始化动作触发器
  invocationCounter_init();  // before any methods loaded
  // 初始化MarkSweep
  marksweep_init();
  // 初始化访问标识
  accessFlags_init();
  // 初始化操作码模板表
  templateTable_init();
  // 接口支持提供了VM_LEAF_BASE和VM_ENTRY_BASE宏
  InterfaceSupport_init();
  SharedRuntime::generate_stubs();
  // 初始化语法表及系统字典等
  universe2_init();  // dependent on codeCache_init and stubRoutines_init1
  // 初始化软引用时间戳表并设定软引用清除策略
  referenceProcessor_init();
  jni_handles_init();
  // 代码数据结构的必要性检查(仅限debug版本)
  vmStructs_init();
  vtableStubs_init();
  InlineCacheBuffer_init();
  // oracle编译器初始化(oracle编译器是一个编译器开关接口)
  compilerOracle_init();
  // 初始化编译策略(根据启动参数决定编译策略)
  compilationPolicy_init();
  compileBroker_init();
  VMRegImpl::set_regName();
  // 执行初始化
  if (!universe_post_init()) {
    return JNI_ERR;
  }
  // 计算各种filed的偏移量??
  javaClasses_init();   // must happen after vtable initialization
  stubRoutines_init2(); // note: StubRoutines need 2-phase init

  // All the flags that get adjusted by VM_Version_init and os::init_2
  // have been set so dump the flags now.
  if (PrintFlagsFinal) {
    CommandLineFlags::printFlags(tty, false);
  }

  return JNI_OK;
}