示例#1
0
void JSDOMGlobalObject::addBuiltinGlobals(VM& vm)
{
    m_builtinInternalFunctions.initialize(*this, vm);

#if ENABLE(STREAMS_API)
    JSObject* privateReadableStreamControllerConstructor = createReadableStreamControllerPrivateConstructor(vm, *this);
    JSObject* privateReadableStreamReaderConstructor = createReadableStreamReaderPrivateConstructor(vm, *this);

    ASSERT(!constructors().get(privateReadableStreamControllerConstructor->info()).get());
    ASSERT(!constructors().get(privateReadableStreamReaderConstructor->info()).get());
    JSC::WriteBarrier<JSC::JSObject> temp;
    constructors().add(privateReadableStreamControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamControllerConstructor);
    constructors().add(privateReadableStreamReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamReaderConstructor);

    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamControllerPrivateName(), privateReadableStreamControllerConstructor, DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamReaderPrivateName(), privateReadableStreamReaderConstructor, DontDelete | ReadOnly),
    };
    addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
#endif
}
示例#2
0
void JSDOMGlobalObject::mark()
{
    Base::mark();

    JSDOMStructureMap::iterator end = structures().end();
    for (JSDOMStructureMap::iterator it = structures().begin(); it != end; ++it)
        it->second->mark();

    JSDOMConstructorMap::iterator end2 = constructors().end();
    for (JSDOMConstructorMap::iterator it2 = constructors().begin(); it2 != end2; ++it2) {
        if (!it2->second->marked())
            it2->second->mark();
    }
}
示例#3
0
extern C int kernel_main(void)
{
    // Initialize heap
    Memory::initialize(0x00300000);

    RaspiSerial console;

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // TODO: this should be done from the support library too.
    // Later, a user-process should monitor the kernel console buffer and write
    // it to the selected console for the kernel.
#define BANNER \
    "FreeNOS " RELEASE " [" ARCH "/" SYSTEM "] (" BUILDUSER "@" BUILDHOST ") (" COMPILER_VERSION ") " DATETIME "\r\n"

    console.setMinimumLogLevel(Log::Debug);
    console.write(BANNER);
    console.write(COPYRIGHT "\r\n");
    NOTICE("Initializing subsystems");

    ARMMemory mem(128 * 1024 * 1024);
    ARMFactory fac;
    ProcessScheduler sched;
    ProcessManager procs(&fac, &sched);
    ARMKernel kernel(&mem, &procs);

    while (true)
	console.put(console.get());

    return 0;
}
示例#4
0
QObject* ObjectFactory::createObject( const QByteArray& className, QObject* parent)
{
    Constructor constructor = constructors().value( className );
    if ( constructor == NULL )
        return NULL;
    return (*constructor)( parent );
}
示例#5
0
extern C int kernel_main()
{
    // Initialize heap at 3MB offset
    // TODO: fix this
    Kernel::heap( MegaByte(3),
                  MegaByte(1) );

    // Start kernel debug serial console
    // TODO: can I re-use the user-land driver here somehow????
    IntelSerial *serial = new IntelSerial(0x3f8);
    serial->setMinimumLogLevel(Log::Notice);

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Kernel memory range (first 4MB, includes 1MB heap)
    Memory::Range kernelRange;
    kernelRange.phys = 0;
    kernelRange.size = MegaByte(4);

    // RAM physical range for this core (SplitAllocator lower memory).
    Memory::Range ramRange;
    ramRange.phys = 0;
    ramRange.size = (multibootInfo.memUpper * 1024) + MegaByte(1);

    // Create and run the kernel
    IntelKernel *kernel = new IntelKernel(kernelRange, ramRange);
    return kernel->run();
}
示例#6
0
int _main(void){
	core_setclock();
	_hwpl_core_priv_enable_interrupts(NULL);
	constructors();
	task_init_single(main, (void*)&_data, (size_t)&_sram_size);
	destructors();
	return 0;
}
示例#7
0
void JSDOMGlobalObject::visitChildren(SlotVisitor& visitor)
{
    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(structure()->typeInfo().overridesVisitChildren());
    Base::visitChildren(visitor);

    JSDOMStructureMap::iterator end = structures().end();
    for (JSDOMStructureMap::iterator it = structures().begin(); it != end; ++it)
        visitor.append(&it->second);

    JSDOMConstructorMap::iterator end2 = constructors().end();
    for (JSDOMConstructorMap::iterator it2 = constructors().begin(); it2 != end2; ++it2)
        visitor.append(&it2->second);

    if (m_injectedScript)
        visitor.append(&m_injectedScript);
}
示例#8
0
void JSDOMGlobalObject::addBuiltinGlobals(VM& vm)
{
    m_builtinInternalFunctions.initialize(*this);

#if ENABLE(READABLE_STREAM_API)
    JSObject* privateReadableStreamDefaultControllerConstructor = createReadableStreamDefaultControllerPrivateConstructor(vm, *this);
#if ENABLE(READABLE_BYTE_STREAM_API)
    JSObject* privateReadableByteStreamControllerConstructor = createReadableByteStreamControllerPrivateConstructor(vm, *this);
#endif
    JSObject* privateReadableStreamDefaultReaderConstructor = createReadableStreamDefaultReaderPrivateConstructor(vm, *this);

    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultControllerConstructor->info()).get());
#if ENABLE(READABLE_BYTE_STREAM_API)
    ASSERT(!constructors(NoLockingNecessary).get(privateReadableByteStreamControllerConstructor->info()).get());
#endif
    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultReaderConstructor->info()).get());
    JSC::WriteBarrier<JSC::JSObject> temp;
    {
        auto locker = lockDuringMarking(vm.heap, m_gcLock);
        constructors(locker).add(privateReadableStreamDefaultControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamDefaultControllerConstructor);
#if ENABLE(READABLE_BYTE_STREAM_API)
        constructors(locker).add(privateReadableByteStreamControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableByteStreamControllerConstructor);
#endif
        constructors(locker).add(privateReadableStreamDefaultReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamDefaultReaderConstructor);
    }
#endif
    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().makeThisTypeErrorPrivateName(),
            JSFunction::create(vm, this, 2, String(), makeThisTypeErrorForBuiltins), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().makeGetterTypeErrorPrivateName(),
            JSFunction::create(vm, this, 2, String(), makeGetterTypeErrorForBuiltins), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().structuredCloneArrayBufferPrivateName(),
            JSFunction::create(vm, this, 1, String(), structuredCloneArrayBuffer), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().structuredCloneArrayBufferViewPrivateName(),
            JSFunction::create(vm, this, 1, String(), structuredCloneArrayBufferView), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(vm.propertyNames->builtinNames().ArrayBufferPrivateName(), getDirect(vm, vm.propertyNames->ArrayBuffer), DontDelete | ReadOnly),
#if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API)
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
#endif
#if ENABLE(READABLE_STREAM_API)
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamDefaultControllerPrivateName(), privateReadableStreamDefaultControllerConstructor, DontDelete | ReadOnly),
#if ENABLE(READABLE_BYTE_STREAM_API)
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableByteStreamControllerPrivateName(), privateReadableByteStreamControllerConstructor, DontDelete | ReadOnly),
#endif
        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamDefaultReaderPrivateName(), privateReadableStreamDefaultReaderConstructor, DontDelete | ReadOnly),
#endif
    };
    addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
}
示例#9
0
文件: Main.cpp 项目: Alexis97/FreeNOS
extern C int kernel_main(u32 r0, u32 r1, u32 r2)
{
    // Invalidate all caches now
    Arch::Cache cache;
    cache.invalidate(Cache::Unified);

#ifdef ARMV7
    // Raise the SMP bit for ARMv7
    ARMControl ctrl;
    ctrl.set(ARMControl::SMPBit);
#endif

    // Retrieve boot image from ATAGS
    Arch::MemoryMap mem;
    BroadcomInterrupt irq;
    ARMTags tags(r2);
    Memory::Range initrd = tags.getInitRd2();

    // Fill coreInfo
    MemoryBlock::set(&coreInfo, 0, sizeof(CoreInfo));
    coreInfo.bootImageAddress = initrd.phys;
    coreInfo.bootImageSize    = initrd.size;
    coreInfo.kernel.phys      = 0;
    coreInfo.kernel.size      = MegaByte(4);
    coreInfo.memory.phys      = 0;
    coreInfo.memory.size      = MegaByte(512);

    // Initialize heap
    Kernel::heap( MegaByte(3), MegaByte(1) );

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Open the serial console as default Log
    RaspiSerial console;
    console.setMinimumLogLevel(Log::Notice);

    // Create the kernel
    ARMKernel kernel(&irq, &coreInfo);

    // Run the kernel
    return kernel.run();
}
示例#10
0
extern C int kernel_main(u32 r0, u32 r1, u32 r2)
{
    Arch::MemoryMap mem;
    BroadcomInterrupt irq;
    ARMTags tags(r2);
    Memory::Range initrd = tags.getInitRd2();

    // Fill coreInfo
    MemoryBlock::set(&coreInfo, 0, sizeof(CoreInfo));
    coreInfo.bootImageAddress = initrd.phys;
    coreInfo.bootImageSize    = initrd.size;
    coreInfo.kernel.phys      = 0;
    coreInfo.kernel.size      = MegaByte(4);
    coreInfo.memory.phys      = 0;
    coreInfo.memory.size      = MegaByte(512);

    // Initialize heap
    Kernel::heap( MegaByte(3), MegaByte(1) );

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Open the serial console as default Log
    RaspiSerial console;
    console.setMinimumLogLevel(Log::Notice);

    // Create the kernel
    ARMKernel kernel(&irq, &coreInfo);

    // Print some info
    DEBUG("ATAGS = " << r2);
    ARMControl ctrl;
    DEBUG("MainID = " << ctrl.read(ARMControl::MainID));
    ctrl.write(ARMControl::UserProcID, 11223344);
    DEBUG("UserProcID = " << ctrl.read(ARMControl::UserProcID));

    // Run the kernel
    return kernel.run();
}
示例#11
0
extern C int kernel_main(CoreInfo *info)
{
    // Initialize heap at 3MB offset
    // TODO: fix this
    Kernel::heap( MegaByte(3),
                  MegaByte(1) );

    // Start kernel debug serial console
    // TODO: can I re-use the user-land driver here somehow????
    if (info->coreId == 0)
    {
        IntelSerial *serial = new IntelSerial(0x3f8);
        serial->setMinimumLogLevel(Log::Notice);
    }

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Create and run the kernel
    IntelKernel *kernel = new IntelKernel(info);
    return kernel->run();
}
示例#12
0
文件: Main.cpp 项目: poluo/FreeNOS
extern C int kernel_main(u32 r0, u32 r1, u32 r2)
{
    Arch::MemoryMap mem;
    BCM2835Interrupt irq;

    // Initialize heap
    Kernel::heap( MegaByte(3), MegaByte(1) );

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Open the serial console as default Log
    RaspiSerial console;
    console.setMinimumLogLevel(Log::Notice);

    // Kernel memory range
    Memory::Range kernelRange;
    kernelRange.phys = 0;
    kernelRange.size = MegaByte(4);

    // RAM physical range
    Memory::Range ramRange;
    ramRange.phys = 0;
    ramRange.size = MegaByte(512);

    // Create the kernel
    ARMKernel kernel(kernelRange, ramRange, &irq, r2);

    // Print some info
    DEBUG("ATAGS = " << r2);
    ARMControl ctrl;
    DEBUG("MainID = " << ctrl.read(ARMControl::MainID));
    ctrl.write(ARMControl::UserProcID, 11223344);
    DEBUG("UserProcID = " << ctrl.read(ARMControl::UserProcID));

    // Run the kernel
    return kernel.run();
}