In Linux, say I have a PCI device that has a large amount of on-board idle memory, and the driver for it is able to effectively communicate with that memory region in a load/store manner. There is a visible memory mapping region when the BAR is properly set, so that if a user program invokes mmap using that BAR address as an input, it can communicate correctly as if it were normal system memory.
My question is, how can I tell the kernel memory manager that this particular BAR space is just normal system memory, such that calls to malloc will also know that it can use this region?
Note: This is kind of the opposite use case for what most people would typically do when they allocate system memory to say a graphics device. I am trying to use a graphics device memory as system RAM whenever possible.