[PATCH rtems-libbsd 1/2] microblaze: Add AXI Ethernet support

Chris Johns chrisj at rtems.org
Sat Jan 22 05:38:39 UTC 2022


On 21/1/22 8:18 am, Alex White wrote:
> On Thu, Jan 20, 2022 at 12:30 AM Chris Johns <chrisj at rtems.org> wrote:
>>
>> On 20/1/22 2:54 pm, Alex White wrote:
>>> From: Jennifer Averett <jennifer.averett at oarcorp.com>
>>>  rtemsbsd/rtems/rtems-kernel-vmem.c            |   17 +
>>> diff --git a/rtemsbsd/rtems/rtems-kernel-vmem.c b/rtemsbsd/rtems/rtems-kernel-vmem.c
>>> index f64fbd17..70708902 100644
>>> --- a/rtemsbsd/rtems/rtems-kernel-vmem.c
>>> +++ b/rtemsbsd/rtems/rtems-kernel-vmem.c
>>> @@ -41,6 +41,11 @@
>>>
>>>  static MALLOC_DEFINE(M_VMEM, "vmem", "VMEM buffers");
>>>
>>> +int vmem_add(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int flags)
>>> +{
>>> +     return 0;
>>> +}
>>> +
>>>  int
>>>  vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vmem_addr_t *addrp)
>>>  {
>>> @@ -48,6 +53,18 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vmem_addr_t *addrp)
>>>       return 0;
>>>  }
>>>
>>> +static int dummy_vmem;
>>> +
>>> +vmem_t *vmem_create(const char *name, vmem_addr_t base,
>>> +    vmem_size_t size, vmem_size_t quantum, vmem_size_t qcache_max, int flags)
>>> +{
>>> +     return &dummy_vmem;
>>> +}
>>> +
>>> +void vmem_destroy(vmem_t *vm)
>>> +{
>>> +}
>>> +
>>>  void
>>>  vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t size)
>>>  {
>>
>> What is pulling this interface in?
> 
> The added vmem functions are pulled in by freebsd/sys/dev/xdma/xdma.c

So how can it be an empty stub and the XDMA driver operate? Is the allocator
being called?

>>
>> Why have they been stubbed out?
> 
> They were stubbed out to provide the minimal implementation needed to get xdma working, and xdma is ultimately used by the AXI Ethernet subsystem.
> 
> The alternatives we saw were to pull in the full FreeBSD vmem implementation (overkill) or modify
> freebsd/sys/dev/xdma/xdma.c to not use vmem functions.

What sort of memory does this allocator allocate? Can some heap memory be used?

Chris


More information about the devel mailing list