I know that I should know how to do this, but for some reason it is
escapeing me right now and I was hoping someone here could help. I
need to setup a pointer to the memory location 0x30000000. I am
working on a linux system that has hardware inputs remapped to that
address and I have to read them. I am just drawing a blank on how to
actually assign the address of a pointer to point to. 7 1321
PullnOutHair wrote: I know that I should know how to do this, but for some reason it is escapeing me right now and I was hoping someone here could help. I need to setup a pointer to the memory location 0x30000000. I am working on a linux system that has hardware inputs remapped to that address and I have to read them. I am just drawing a blank on how to actually assign the address of a pointer to point to.
You don't do it in userland. That said.
assert(sizeof(v oid*) >= sizeof(unsigned long))
void* ptr = reinterpret_cas t<void*>(0x3000 0000UL);
red floyd <no*****@here.d ude> wrote in message news:<ID******* *********@newss vr27.news.prodi gy.com>... You don't do it in userland. That said.
What do you mean? assert(sizeof(v oid*) >= sizeof(unsigned long)) void* ptr = reinterpret_cas t<void*>(0x3000 0000UL);
"PullnOutHa ir" <di*********@ho tmail.com> wrote in message
news:ca******** *************** ***@posting.goo gle.com... red floyd <no*****@here.d ude> wrote in message
news:<ID******* *********@newss vr27.news.prodi gy.com>... You don't do it in userland. That said.
What do you mean? http://info.astrian.net/jargon/terms/u/userland.html
Jonathan
PullnOutHair wrote: I know that I should know how to do this, but for some reason it is escapeing me right now and I was hoping someone here could help. I need to setup a pointer to the memory location 0x30000000. I am working on a linux system that has hardware inputs remapped to that address and I have to read them. I am just drawing a blank on how to actually assign the address of a pointer to point to.
Assuming that the platform will allow you, and assuming the pointer is
of type whatever, you can do:
whatever *p = reinterpret_cas t<whatever *>(0x30000000) ;
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys
Ioannis Vranos posted: PullnOutHair wrote:
I know that I should know how to do this, but for some
reason it is escapeing me right now and I was hoping someone here
could help. I need to setup a pointer to the memory location
0x30000000. I am working on a linux system that has hardware inputs
remapped to that address and I have to read them. I am just drawing a
blank on how to actually assign the address of a pointer to point to.
Assuming that the platform will allow you, and assuming
the pointer is of type whatever, you can do: whatever *p = reinterpret_cas t<whatever *>(0x30000000) ; Regards,
Ioannis Vranos
http://www23.brinkster.com/noicys
Should the "volatile" keyword be in there at all?
-JKop
JKop wrote: Ioannis Vranos posted:
whatever *p = reinterpret_cas t<whatever *>(0x30000000) ;
Should the "volatile" keyword be in there at all?
-JKop
Depends on whether it's data that can change out from underneath him.
My favorite variant of this (embedded system, C, not C++) was:
const volatile unsigned long * const PREGISTER =
(const volatile unsigned long *) 0xC0000000L;
It was a read-only memory mapped register.
JKop wrote: whatever *p = reinterpret_cas t<whatever *>(0x30000000) ;
Should the "volatile" keyword be in there at all?
volatile is used when the value of the variable can change between reads
outside of the program (e.g. an external thermometer). It has as a
result the compiler to not perform some optimisations.
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Holly |
last post by:
I'm trying to validate my code and I can't figure out what kind of doctype
I have. The validator can't tell me anything because it can't move beyond
the doctype declaration.
http://www.wavian.com/clients/pugwash/
Is there anyway to tell what kind of doctype this is? I tried inserting a
few different types (please excuse me if this is the stupid way to do it,
I am learning...) but am unsuccessful.
|
by: cody |
last post by:
I have a method that gets called if the user presses a certain button.
If the object is in a state that doesn't allow the calling of that method,
what should I do? Should I better throw an InvalidOperationException or
should I derive my own exceptions from ApplicationException?
In general, it is not clear to me when to use the predefined exceptions and
when to create new ones by deriving from ApplicationException.
And a last question:...
|
by: Scott Smedley |
last post by:
Hi all,
I'm trying to write a special adaptor iterator for my program. I have
*almost* succeeded, though it fails under some circumstances.
See the for-loop in main().
Any pointers/help would be muchly appreciated.
Apologies for the long post - I couldn't find a shorter way to
|
by: Joseph Turian |
last post by:
Fellow hackers,
I have a class BuildNode that inherits from class Node.
Similarly, I have a class BuildTree that inherits from class Tree.
Tree includes a member variable:
vector<Node> nodes; // For clarity, let this be "orig_nodes"
BuildTree includes a member variable:
|
by: Hoopster |
last post by:
Hello,
I know nothing about C++ but want to get started.
Is there any good free C++ program that I can try to see if I like
programming? I also need a good free compiler. I don't want to
purchased the regular VB C++ until I know that I will like it.
| |
by: Lampa Dario |
last post by:
Hi, where is this stupid error in this program? When I execute it, i
receive a segmentation fault error.
#include <stdio.h>
int main(int argc, char *argv, char *env) { int i=0; int l=0;
int word=0;
char *querystring;
querystring=malloc(sizeof(char)*100000);
if (getenv("QUERY_STRING")==NULL)
|
by: Frederick Gotham |
last post by:
Before I begin, here's a list of assumptions for this particular example:
(1) unsigned int has no padding bits, and therefore no invalid bit-
patterns or trap representations.
(2) All types have the same alignment requirements.
(3) sizeof(double) >= sizeof(unsigned)
=====================================
We can cast from double to unsigned int as follows:
|
by: RvGrah |
last post by:
I'm using the Activated event of my form to run a database query in a
backroundWorker, and want to dismiss the call after the first time the
form is activated. Based on some excellent advice in an earlier post,
instead of maintaining a flag, I'm unsubscribing to this eventHandler.
My question is, why is this functional:
this.Activated -= new
System.EventHandler(Form1_Activated);
instead of:
|
by: ot_007_2001 |
last post by:
Hi, all,
For pricticing defination of structure in C, I wrote a small code as
follow:
#include<stdio.h>
struct datastruct
{
int data;
|
by: Chris Becke |
last post by:
In C and in older C++ compilers, you could write code like this
void a(void** pp); // declare a function that takes a pointer to a pointer-to-void.
struct I {}; // some struct.
I *i1,**i2; // some kinds of i.
a(&i1); // this works
a(i2); // this also worked.
a(i1); // error: incorrect levels of indirection
a(&i2); // error: incorrect levels of indirection
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |