Operating System - HP-UX
1748186 Members
4711 Online
108759 Solutions
New Discussion юеВ

Re: Equivalent of asm/atomic.h

 
SOLVED
Go to solution
adityahuawei
Occasional Contributor

Equivalent of asm/atomic.h

Hi Everybody,

While porting from suselinux to HP-UX we are not able to find the file atomic.h.
In suse linux we include
#include

In HP-UX 11.23 ia64 machine what is the equivalent of it ?Thanks in advance
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: Equivalent of asm/atomic.h

> In suse linux we include
> #include

Why? What's in it that you need? (And are
you doing that on HP-UX?)
Matti_Kurkela
Honored Contributor
Solution

Re: Equivalent of asm/atomic.h

asm/atomic.h seems to be one of Linux kernel header files. This means it's a part of kernel API, and normal programs should not be using it. The kernel API should be used by kernel components only.

"asm" in the pathname indicates the file is related to routines written in assembler: assembler code is definitely not portable to a different CPU architecture, and must be re-implemented. You should read the documentation of your compiler to find out what it can do to guarantee the atomicity of a particular operation, or start learning some ia64 assembler.

The HP-UX kernel API is very different from its Linux counterpart. Don't expect to find a one-to-one match for header files: there is no standard that would determine how the internal APIs of an Unix-style kernel should be structured.

Porting a kernel driver from Linux to HP-UX will be a lot more difficult than porting userspace software that uses only the standard POSIX API which is common to both OSs. You may have to try and understand what the driver is trying to achieve, then re-implement it to get the same result in "HP-UX Way".

If you're porting a driver for HP-UX, I assume you're already familiar with the documentation in the Driver Development Kit?

http://www.hp.com/go/hpux_ddk

MK
MK
Dennis Handly
Acclaimed Contributor

Re: Equivalent of asm/atomic.h

adityahuawei
Occasional Contributor

Re: Equivalent of asm/atomic.h

Thank you guys,

will keep all these points while porting.