From: wyang1 <Wei.Yang@windriver.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/:] For mips architecture, SHMLBA is not equal to PAGE_SIZE base_addr is not available address for process after base_addr is aligned to next SHMLBA address. so we should probe a bigger available virtual address space for ensuring that a wide range from base_addr aligned to next SHMLBA to base_addr + INT_SIZE always is available
Date: Tue, 27 Dec 2011 14:59:17 +0800 [thread overview]
Message-ID: <4EF96CC5.4090604@windriver.com> (raw)
In-Reply-To: <1324968340-14847-1-git-send-email-Wei.Yang@windriver.com>
[-- Attachment #1.1: Type: text/plain, Size: 2414 bytes --]
Hi Cyril
Please ignore this patch. I am so sorry for my fault.:-[ I will resend
it.
thanks
wei
On 12/27/2011 02:45 PM, Wei.Yang@windriver.com wrote:
> From: Wei Yang<Wei.Yang@windriver.com>
>
>
> Signed-off-by: Wei Yang<Wei.Yang@windriver.com>
> ---
> testcases/kernel/syscalls/ipc/shmat/shmat01.c | 27 +++++++++++++++++++++++-
> 1 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat01.c b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
> index 7c68459..344ad3f 100644
> --- a/testcases/kernel/syscalls/ipc/shmat/shmat01.c
> +++ b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
> @@ -65,6 +65,9 @@ void check_functionality(int);
> #define CASE1 20 /* memory location. */
>
> int shm_id_1 = -1;
> +#if defined(__mips__) || defined(__mips64)
> +int shm_id_2 = -1;
> +#endif
>
> void *base_addr; /* By probing this address first, we can make
> * non-aligned addresses from it for different
> @@ -262,14 +265,34 @@ void setup(void)
> tst_brkm(TBROK, cleanup, "Failed to create shared memory "
> "resource 1 in setup()");
> }
> -
> /* Probe an available linear address for attachment */
> +#if defined(__mips__) || defined(__mips64)
> + /*
> + * For mips architecture, SHMLBA is not equal to PAGE_SIZE
> + * base_addr is not available address for process after
> + * base_addr is aligned to next SHMLBA address
> + */
> + if ((shm_id_2 = shmget(shmkey++, SHMLBA, SHM_RW | IPC_CREAT | IPC_EXCL)) == -1) {
> + tst_brkm(TBROK, cleanup, "Failed to create shared memory ");
> + }
> + if ((base_addr = shmat(shm_id_2, NULL, 0)) == (void *) -1) {
> + rm_shm(shm_id_2);
> + tst_brkm(TBROK, cleanup, "Couldn't attach shared memory");
> + }
> + if (shmdt((const void *)base_addr) == -1) {
> + rm_shm(shm_id_2);
> + tst_brkm(TBROK, cleanup, "Couldn't detach shared memory");
> + }
> + rm_shm(shm_id_2);
> +#else
> if ((base_addr = shmat(shm_id_1, NULL, 0)) == (void *)-1) {
> tst_brkm(TBROK, cleanup, "Couldn't attach shared memory");
> }
> if (shmdt((const void *)base_addr) == -1) {
> tst_brkm(TBROK, cleanup, "Couldn't detach shared memory");
> }
> +#endif
> +
>
> /* some architectures (e.g. parisc) are strange, so better always align to
> * next SHMLBA address. */
> @@ -299,4 +322,4 @@ void cleanup(void)
> */
> TEST_CLEANUP;
>
> -}
> \ No newline at end of file
> +}
[-- Attachment #1.2: Type: text/html, Size: 3481 bytes --]
[-- Attachment #2: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2011-12-27 6:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-27 6:45 [LTP] [PATCH 1/:] For mips architecture, SHMLBA is not equal to PAGE_SIZE base_addr is not available address for process after base_addr is aligned to next SHMLBA address. so we should probe a bigger available virtual address space for ensuring that a wide range from base_addr aligned to next SHMLBA to base_addr + INT_SIZE always is available Wei.Yang
2011-12-27 6:59 ` wyang1 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF96CC5.4090604@windriver.com \
--to=wei.yang@windriver.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.