Sponsored Content
Top Forums Programming Linux Kernel code "current" macro Post 302534952 by kumaran_5555 on Wednesday 29th of June 2011 08:23:14 AM
Old 06-29-2011
Linux Kernel code "current" macro

I was going through the Linux code, i stuck with few inline assembly language code,

I have tried online but in vain. Any help is much appreciated. Thanks.

Code:
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
    struct thread_info *ti;
    __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
    return ti;
}

I have understood the point that it is being taken from kernel mode stack of size 8192 bytes. But couldn't understand the assembly langauage instruction.

Last edited by kumaran_5555; 06-29-2011 at 09:44 AM..
 

4 More Discussions You Might Find Interesting

1. Solaris

Compliation Error in solaris - macro "min" requires 2 arguments, but only 1 given

Hi, I am trying to compile our linux code base in solaris and came across the following issues. Am I suppose to do something special ? Can anyone help me to fix this issue. System : uname -a SunOS aspen 5.10 Generic_125100-08 sun4u sparc SUNW,Sun-Fire-280R The complier that I am using is... (0 Replies)
Discussion started by: learningkid
0 Replies

2. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

3. Linux

Supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" me

supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" message comes. I tried giving acpi=off to the kernel command line but same problem.It shows everything ok and no problem with memory and processors and power supplies.Wt could be the reason? It has... (1 Reply)
Discussion started by: pankajd
1 Replies

4. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies
Helpers for manipulating Linux libnuma bitmask(3)	     Hardware Locality (hwloc)		 Helpers for manipulating Linux libnuma bitmask(3)

NAME
Helpers for manipulating Linux libnuma bitmask - Functions static inline struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) " static inline struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) " static inline int hwloc_cpuset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask) static inline int hwloc_nodeset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask) Detailed Description Function Documentation static inline int hwloc_cpuset_from_linux_libnuma_bitmask (hwloc_topology_ttopology, hwloc_cpuset_tcpuset, const struct bitmask *bitmask) [static] Convert libnuma bitmask bitmask into hwloc CPU set cpuset. This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter. static inline struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (hwloc_topology_ttopology, hwloc_const_cpuset_tcpuset) [static], [read] Convert hwloc CPU set cpuset into the returned libnuma bitmask. The returned bitmask should later be freed with numa_bitmask_free. This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter. Returns: newly allocated struct bitmask. static inline int hwloc_nodeset_from_linux_libnuma_bitmask (hwloc_topology_ttopology, hwloc_nodeset_tnodeset, const struct bitmask *bitmask) [static] Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset. This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter. static inline struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (hwloc_topology_ttopology, hwloc_const_nodeset_tnodeset) [static], [read] Convert hwloc NUMA node set nodeset into the returned libnuma bitmask. The returned bitmask should later be freed with numa_bitmask_free. This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter. Returns: newly allocated struct bitmask. Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.7 Sun Apr 7 2013 Helpers for manipulating Linux libnuma bitmask(3)
All times are GMT -4. The time now is 10:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy