DMA : 32-bit physical address -> 16-bit segment/offset

DMA : 32-bit physical address -> 16-bit segment/offset

Post by Gary L. Schap » Wed, 03 Jan 1996 04:00:00



How does one convert the 32-bit physical address, "cookie.dmac_address",
returned by ddi_dma_addr_bind_handle() into 16-bit segment and offset?
These macros don't seem to cut it:

#define SEGMENT(addr)   ((addr & 0xffff0000) >> 16)
#define OFFSET(addr)    (addr & 0x0000ffff)

Thanks.
--
---

 
 
 

DMA : 32-bit physical address -> 16-bit segment/offset

Post by Courtney Bro » Thu, 04 Jan 1996 04:00:00




Quote:> How does one convert the 32-bit physical address, "cookie.dmac_address",
> returned by ddi_dma_addr_bind_handle() into 16-bit segment and offset?
> These macros don't seem to cut it:

> #define SEGMENT(addr)   ((addr & 0xffff0000) >> 16)
> #define OFFSET(addr)    (addr & 0x0000ffff)

#define SEGMENT(addr) ((addr & 0xfffffff0) >> 4)
#define OFFSET(addr) (addr & 0x0000000f)

Quote:> Thanks.

Yer Welcome

--
Hey! Check out http://www.rsphere.com/

 
 
 

1. I need to run 16-bit executable on 32-bit OS

(My previous posting's description seems to have its ending "?" truncated,
so I am re-posting with a new description.)

What I need is the ability to -run- existing 16-bit compiled and linked code
on a 32-bit UNIX operating system and have it interface to native UNIX code.

I have a package running on an 80286.  I want to move it to a UNIX platform,
and UnixWare is what my company would like to use.

The package DOES NOT run under DOS.  It runs on our own system which DOES
NOT use any protected mode capabilities of the 80286.  However, executables
that we load and run -are- in DOS's 16-bit ".EXE" format (the non-Windows
format).  Loading the executable into memory is not a problem.  I already
have a solution for that.  What I need to resolve is the following:

  1.  How do I tell UnixWare that the code I want it to execute is 16-bit
        code, and
  2.  How do I call 32-bit routines from the 16-bit code?

Note:  The executable is already being passed the address of a table of
service routine addresses in segment:offset format.  The executable then
uses these routine addresses for every access to system services for file,
I/O, and other operations.

BTW:  UnixWare -does- come with a product called Merge from Locus Computing
Corporation, but it does not fully meet our needs.

--

Apertus Technologies                                       (612) 828-0582
Eden Prairie, MN

2. Motorola 56k Problem

3. what NIC in HP Vectra 486/25NI ????

4. SpeedStar64 on 16-bit & 32-bit modes

5. Promise DC-4030Vl IDE Caching Controller

6. How to run a 16-bit executable on a 32-bit OS?

7. profile question

8. Can't use 16-bit, 32-bit modes

9. mrand48() returning 16-bit longs, instead of 32-bit

10. difference between 16-bit & 32-bit OPERATING SYSTEMS

11. Calling 16-bit PM code from 32-bit PM Kernel Driver

12. MIPS32 VM/ioremap question mapping 32 bit virtual address to 36 bit physical