Arm Community
Site
Search
User
Site
Search
User
Groups
Research Collaboration and Enablement
DesignStart
Education Hub
Innovation
Open Source Software and Platforms
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello Forum
Operating Systems forum
SoC Design and Simulation forum
中文社区论区
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Innovation blog
Internet of Things (IoT) blog
Operating Systems blog
Research Articles
SoC Design and Simulation blog
Tools, Software and IDEs blog
中文社区博客
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Arm Development Studio forum
Function returns structure problem in ARM926
Jump...
Cancel
Locked
Locked
Replies
5 replies
Subscribers
121 subscribers
Views
2978 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Function returns structure problem in ARM926
Offline
reddyr reddyr
over 9 years ago
Parents
Offline
reddyr reddyr
over 9 years ago
Note: This was originally posted on 5th July 2009 at
http://forums.arm.com
Thanks for your kind and reply..
Still i couldnt solve my problem,i will explain you logic in my
application
struct A
{
int k[10];
int l[10];
int m[10];
};
static struct B
{
int a[10];
int b[10];
int c[10];
};
struct B should be static structure because
I am calling f2() function many times in my suppilcation,so next time when i call the function f2() it should have previous values of f2()so it should be static
############ main.c #################
main()
{
f4()
{
f3(); frist time
f3(); second time the values of f2() will use here
}
############## test.c #######################
f3()
{
f2();
}
#########################################
In f2() we should modify static strure B vlues,by passing refernce of B to f2() function.In side the function f2() using another structure (structure A),with A object we should modify values and should return updated static data values.
I should not use static structre vabiles in f2() because inside f2() function i have tight for loops and doing math operation on values,so copy static values to local variable and modify those varibles with math operations and return those varibles to satic structure.
I should not do math operations on static variables,becuase it will take more core cycles than local varibles, thats why i am copying to another local structe and do math operations.
Please give me the solution how can i do this..
waiting for kind reply
Cancel
Up
0
Down
Cancel
Reply
Offline
reddyr reddyr
over 9 years ago
Note: This was originally posted on 5th July 2009 at
http://forums.arm.com
Thanks for your kind and reply..
Still i couldnt solve my problem,i will explain you logic in my
application
struct A
{
int k[10];
int l[10];
int m[10];
};
static struct B
{
int a[10];
int b[10];
int c[10];
};
struct B should be static structure because
I am calling f2() function many times in my suppilcation,so next time when i call the function f2() it should have previous values of f2()so it should be static
############ main.c #################
main()
{
f4()
{
f3(); frist time
f3(); second time the values of f2() will use here
}
############## test.c #######################
f3()
{
f2();
}
#########################################
In f2() we should modify static strure B vlues,by passing refernce of B to f2() function.In side the function f2() using another structure (structure A),with A object we should modify values and should return updated static data values.
I should not use static structre vabiles in f2() because inside f2() function i have tight for loops and doing math operation on values,so copy static values to local variable and modify those varibles with math operations and return those varibles to satic structure.
I should not do math operations on static variables,becuase it will take more core cycles than local varibles, thats why i am copying to another local structe and do math operations.
Please give me the solution how can i do this..
waiting for kind reply
Cancel
Up
0
Down
Cancel
Children
No data