tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 4byte aligned com(4) and PCI_MAPREG_TYPE_MEM



Hi, Christos.

(2014/02/10 5:26), Christos Zoulas wrote:
> In article <52F7C96E.6000601%execsw.org@localhost>,
> SAITOH Masanobu  <msaitoh%execsw.org@localhost> wrote:
>> Hello, all.
>>
>> I'm now working to support Intel Quark X1000.
>> This chip's internal com is MMIO(PCI_MAPREG_TYPE_MEM).
>> Our com and puc don't support such type of device, yet.
>> To solve the problem, I wrote a patch.
>>
>> Registers of Quark X1000's com are 4byte aligned.
>> Some other machines have such type of device, so
>> I modified COM_INIT_REGS() macro to support both
>> byte aligned and 4byte aligned. This change reduce
>> special modifications done in atheros, rmi and
>> marvell drivers.
>>
>> One of problem is serial console on i386 and amd64.
>> These archs calls consinit() three times. The function
>> is called in the following order:
>>
>>      1) machdep.c::init386() or init_x86_64()
>>      2) init_main.c::main()
>>      *) (call uvm_init())
>>      *) (call extent_init())
>>      3) machdep.c::cpu_startup()
>>
>> When consinit() called in init386(), it calls
>>
>>  comcnattach()
>>    ->comcnattach1()
>>      ->comcninit()
>>        -> bus_space_map() with x86_bus_space_mem tag.
>>          ->bus_space_reservation_map()
>>            ->x86_mem_add_mapping()
>>              ->uvm_km_alloc()
>>                panic in KASSERT(vm_map_pmap(map) == pmap_kernel());
>>
>> What should I do?
>> One of the solution is to check whether extent_init() was called
>> or not. There is no easy way to know it, so I added a global
>> variable "extent_initted". Is it acceptable?
> 
> Looks great, can't you use "cold" instead, or is that too late?

No, we can't. That's too late. The variable is set in configure2().

> christos
> 


-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index