From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web12.10415.1655149187113849083 for ; Mon, 13 Jun 2022 12:39:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N5Xin50R; spf=pass (domain: gmail.com, ip: 209.85.214.171, mailfrom: xzavierpower@gmail.com) Received: by mail-pl1-f171.google.com with SMTP id g8so733071plt.8 for ; Mon, 13 Jun 2022 12:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=hRt+gfIGvg+Dq/fFytGNwnoMeYHLfhAyXJnwfz8d6d8=; b=N5Xin50RSdIaDnDfwBTYv8HHByMmaOkjdns739dfOtzYJ0/wOBNhUiI4UnhK3qhElD 2jLr7Q5j8/p8/fJhsoXihVj71Eo4ICQFFmI+s2LMYM/9TK/L4pJDyeBYz7pZIBITjeRX KWwkUCocEW0uMZOoqBuCvNY4LHF6SBBnAvz4hL7h2jsAC8fWfmzV2hZ0+XRoNE6HNEBp 3k+BS0mAgkoiU2MWXFKxp/jyJYYIzeDBiyoJyTqHxZrEoVcuGbE1jLvHihGlOEtkA0D0 t6FT7SSiXwbc/vinN1oesZ7x2HM9wkdL/qfeHv080WgrMQC86Mo635fV7xxPYAzZOwfE m4VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hRt+gfIGvg+Dq/fFytGNwnoMeYHLfhAyXJnwfz8d6d8=; b=HWN5MgWnqg/eoIuckB9e3C8DqdKk4hZbKJxF0DV2ekybw68+xOB90rcPUBMt6eSrD0 f9EagYBwVasZ8lMe36PCejYLZ2Y9DNTRa7gae8j/pb/g6gq+40affcEBRlFV8SWjUzKd 6EVXge6VVhkpZbPes/9HpTd1xnvaAzP7HCcCpZCl5oEhAnVio3xU2w2fntbkWKoFFDyE CqQ1mRV4wmIC5c9+RPCZRrLIHZvjM9x7zYthg9p1D+D91qAfB3NgrbRGTm5GGXBgBBkR Jj66kBrz+1tdjAB8hw/h2AVzYNnylwh3JKMx3sepbJBS1MUZa+ckQv9hwsqZDwiM5kKh +/CQ== X-Gm-Message-State: AJIora+OMM7dmnuW0qA0kkWQYRtfASMIW4eaKjc9lMaZMZ0DGF3Plxir jyWX9gPgSZ3qXkpv589MfnO7mGxYS0eXvKRTsu8pRSxq534= X-Google-Smtp-Source: AGRyM1smQLzPdiLp9sQ/qR4mbvzfk4A6nZLGzwPA6r8tldF3KpWNWvl1mME9BSX01k2ufgi6gBVsPSYRrf7PMGH+UqM= X-Received: by 2002:a17:902:db06:b0:167:466e:b6fc with SMTP id m6-20020a170902db0600b00167466eb6fcmr613129plx.108.1655149186442; Mon, 13 Jun 2022 12:39:46 -0700 (PDT) MIME-Version: 1.0 From: "M.T." Date: Mon, 13 Jun 2022 15:39:44 -0400 Message-ID: Subject: Physical Address of buffer To: devel@edk2.groups.io Content-Type: multipart/alternative; boundary="0000000000004eea6b05e15973de" --0000000000004eea6b05e15973de Content-Type: text/plain; charset="UTF-8" Hello I'm trying to port some code which interacts with memory mapped hardware registers. The original code was developed in 2015-18 on edk2, and does not want to compile anymore. The way it works is there are three 32 bit registers. The first is a status/command register which I read to determine if the hardware is ready. The next two are used to pass a 64-bit memory address (hi + lo). Once the param registers are set, I update the command/status register and the hardware executes the command returning the results at the address provided by the two param registers. In the original code, the address of the buffer is used to fill in the two param registers, and as far as I can tell this worked back then. When I try to do the same, the address in my pointer is only 32 bits long, a virtual address, not a physical address. Is there a way I can convert this 32 bit virtual address to a 64-bit physical address in a uefi shell app, or would I need a driver to do this? I did something similar in linux for memory mapped IO, I am guessing I just haven't found the right function for this yet. I would greatly appreciate it if someone could point me in the right direction. Thank you xp --0000000000004eea6b05e15973de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello

I'm trying to port some code = which interacts with memory mapped hardware registers.
The origin= al code was developed in 2015-18 on edk2, and does not want to compile anym= ore.

The way it works is there are three 32 bit re= gisters.
The first is a status/command register which I read to d= etermine if the hardware is ready.
The next two are used to pass = a 64-bit memory address (hi=C2=A0+ lo).
Once the param registers = are set, I update the command/status register and the hardware executes the= command returning the results at the address provided by the two param reg= isters.

In the original code, the address of the b= uffer is used to fill in the two param registers, and as far as I can tell = this worked back then.
When I try to do the same, the address in = my pointer is only 32 bits long, a virtual address, not a physical address.=

Is there a way I can convert this 32 bit virtual = address to a 64-bit physical address in=C2=A0a uefi shell app, or would I n= eed a driver=C2=A0to do this?
I did something similar in linux fo= r memory mapped IO, I am guessing I just haven't found the right functi= on for this yet.

I would greatly appreciate it if = someone could point me in the right direction.

Tha= nk you
xp



--0000000000004eea6b05e15973de--