[PATCH 1/5] Add parsing support for named ioctls APIs

Dmitry V. Levin ldv at altlinux.org
Fri Jan 16 19:31:55 UTC 2015


On Thu, Jan 15, 2015 at 08:32:26PM +0100, Gabriel Laskar wrote:
[...]
> --- a/linux/ioctlent.sh
> +++ b/linux/ioctlent.sh
> @@ -94,6 +94,21 @@ regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\
>  	-e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/	{ "\1",	"\2",	_IOC(_IOC_NONE,\3,\4,0)	},/p' \
>  	>> ioctls.h
>  
> +lookup_named_ioctls() {
> +	api_name=$1
> +
> +	regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*\(([a-z,]*)\)\?[[:space:]]\+'$api_name'_\(IOR\|IOW\|IO\|IOWR\)[[:space:]]*'
> +	(cd $dir && grep $regexp $files 2>/dev/null) | \
> +		sed -n \
> +		-e "s,$asm/,asm/,g" \
> +		-e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*'$api_name'_IO.*(\([^[,]*\)[[:space:]]*,.*/	{ "\1",	"\2",	_IOC(_IOC_NONE,DRM_IOCTL_BASE,\3,0)	},/p' \
> +		>> ioctls.h
> +}
> +
> +lookup_named_ioctls DRM
> +lookup_named_ioctls OMAP
> +lookup_named_ioctls HSC

Why DRM_IOCTL_BASE ('d') is applied not only to DRM but also to HSC
(where its analog is 'k') and OMAP (where its analog is 'O')?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150116/a4341748/attachment.bin>


More information about the Strace-devel mailing list