亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? device-init.c

?? linux內核源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  PS3 device registration routines. * *  Copyright (C) 2007 Sony Computer Entertainment Inc. *  Copyright 2007 Sony Corp. * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; version 2 of the License. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include <linux/delay.h>#include <linux/freezer.h>#include <linux/kernel.h>#include <linux/kthread.h>#include <linux/init.h>#include <asm/firmware.h>#include <asm/lv1call.h>#include <asm/ps3stor.h>#include "platform.h"/** * ps3_setup_gelic_device - Setup and register a gelic device instance. * * Allocates memory for a struct ps3_system_bus_device instance, initialises the * structure members, and registers the device instance with the system bus. */static int __init ps3_setup_gelic_device(	const struct ps3_repository_device *repo){	int result;	struct layout {		struct ps3_system_bus_device dev;		struct ps3_dma_region d_region;	} *p;	pr_debug(" -> %s:%d\n", __func__, __LINE__);	BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB);	BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_GELIC);	p = kzalloc(sizeof(struct layout), GFP_KERNEL);	if (!p) {		result = -ENOMEM;		goto fail_malloc;	}	p->dev.match_id = PS3_MATCH_ID_GELIC;	p->dev.dev_type = PS3_DEVICE_TYPE_SB;	p->dev.bus_id = repo->bus_id;	p->dev.dev_id = repo->dev_id;	p->dev.d_region = &p->d_region;	result = ps3_repository_find_interrupt(repo,		PS3_INTERRUPT_TYPE_EVENT_PORT, &p->dev.interrupt_id);	if (result) {		pr_debug("%s:%d ps3_repository_find_interrupt failed\n",			__func__, __LINE__);		goto fail_find_interrupt;	}	BUG_ON(p->dev.interrupt_id != 0);	result = ps3_dma_region_init(&p->dev, p->dev.d_region, PS3_DMA_64K,		PS3_DMA_OTHER, NULL, 0);	if (result) {		pr_debug("%s:%d ps3_dma_region_init failed\n",			__func__, __LINE__);		goto fail_dma_init;	}	result = ps3_system_bus_device_register(&p->dev);	if (result) {		pr_debug("%s:%d ps3_system_bus_device_register failed\n",			__func__, __LINE__);		goto fail_device_register;	}	pr_debug(" <- %s:%d\n", __func__, __LINE__);	return result;fail_device_register:fail_dma_init:fail_find_interrupt:	kfree(p);fail_malloc:	pr_debug(" <- %s:%d: fail.\n", __func__, __LINE__);	return result;}static int __init_refok ps3_setup_uhc_device(	const struct ps3_repository_device *repo, enum ps3_match_id match_id,	enum ps3_interrupt_type interrupt_type, enum ps3_reg_type reg_type){	int result;	struct layout {		struct ps3_system_bus_device dev;		struct ps3_dma_region d_region;		struct ps3_mmio_region m_region;	} *p;	u64 bus_addr;	u64 len;	pr_debug(" -> %s:%d\n", __func__, __LINE__);	BUG_ON(repo->bus_type != PS3_BUS_TYPE_SB);	BUG_ON(repo->dev_type != PS3_DEV_TYPE_SB_USB);	p = kzalloc(sizeof(struct layout), GFP_KERNEL);	if (!p) {		result = -ENOMEM;		goto fail_malloc;	}	p->dev.match_id = match_id;	p->dev.dev_type = PS3_DEVICE_TYPE_SB;	p->dev.bus_id = repo->bus_id;	p->dev.dev_id = repo->dev_id;	p->dev.d_region = &p->d_region;	p->dev.m_region = &p->m_region;	result = ps3_repository_find_interrupt(repo,		interrupt_type, &p->dev.interrupt_id);	if (result) {		pr_debug("%s:%d ps3_repository_find_interrupt failed\n",			__func__, __LINE__);		goto fail_find_interrupt;	}	result = ps3_repository_find_reg(repo, reg_type,		&bus_addr, &len);	if (result) {		pr_debug("%s:%d ps3_repository_find_reg failed\n",			__func__, __LINE__);		goto fail_find_reg;	}	result = ps3_dma_region_init(&p->dev, p->dev.d_region, PS3_DMA_64K,		PS3_DMA_INTERNAL, NULL, 0);	if (result) {		pr_debug("%s:%d ps3_dma_region_init failed\n",			__func__, __LINE__);		goto fail_dma_init;	}	result = ps3_mmio_region_init(&p->dev, p->dev.m_region, bus_addr, len,		PS3_MMIO_4K);	if (result) {		pr_debug("%s:%d ps3_mmio_region_init failed\n",			__func__, __LINE__);		goto fail_mmio_init;	}	result = ps3_system_bus_device_register(&p->dev);	if (result) {		pr_debug("%s:%d ps3_system_bus_device_register failed\n",			__func__, __LINE__);		goto fail_device_register;	}	pr_debug(" <- %s:%d\n", __func__, __LINE__);	return result;fail_device_register:fail_mmio_init:fail_dma_init:fail_find_reg:fail_find_interrupt:	kfree(p);fail_malloc:	pr_debug(" <- %s:%d: fail.\n", __func__, __LINE__);	return result;}static int __init ps3_setup_ehci_device(	const struct ps3_repository_device *repo){	return ps3_setup_uhc_device(repo, PS3_MATCH_ID_EHCI,		PS3_INTERRUPT_TYPE_SB_EHCI, PS3_REG_TYPE_SB_EHCI);}static int __init ps3_setup_ohci_device(	const struct ps3_repository_device *repo){	return ps3_setup_uhc_device(repo, PS3_MATCH_ID_OHCI,		PS3_INTERRUPT_TYPE_SB_OHCI, PS3_REG_TYPE_SB_OHCI);}static int __init ps3_setup_vuart_device(enum ps3_match_id match_id,	unsigned int port_number){	int result;	struct layout {		struct ps3_system_bus_device dev;	} *p;	pr_debug(" -> %s:%d: match_id %u, port %u\n", __func__, __LINE__,		match_id, port_number);	p = kzalloc(sizeof(struct layout), GFP_KERNEL);	if (!p)		return -ENOMEM;	p->dev.match_id = match_id;	p->dev.dev_type = PS3_DEVICE_TYPE_VUART;	p->dev.port_number = port_number;	result = ps3_system_bus_device_register(&p->dev);	if (result)		pr_debug("%s:%d ps3_system_bus_device_register failed\n",			__func__, __LINE__);	pr_debug(" <- %s:%d\n", __func__, __LINE__);	return result;}static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,				       unsigned int timeout){	int result = -1;	unsigned int retries = 0;	u64 status;	for (retries = 0; retries < timeout; retries++) {		result = lv1_storage_check_async_status(dev_id, tag, &status);		if (!result)			break;		msleep(1);	}	if (result)		pr_debug("%s:%u: check_async_status: %s, status %lx\n",			 __func__, __LINE__, ps3_result(result), status);	return result;}/** * ps3_storage_wait_for_device - Wait for a storage device to become ready. * @repo: The repository device to wait for. * * Uses the hypervisor's storage device notification mechanism to wait until * a storage device is ready.  The device notification mechanism uses a * psuedo device (id = -1) to asynchronously notify the guest when storage * devices become ready.  The notification device has a block size of 512 * bytes. */static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo){	int error = -ENODEV;	int result;	const u64 notification_dev_id = (u64)-1LL;	const unsigned int timeout = HZ;	u64 lpar;	u64 tag;	void *buf;	enum ps3_notify_type {		notify_device_ready = 0,		notify_region_probe = 1,		notify_region_update = 2,	};	struct {		u64 operation_code;	/* must be zero */		u64 event_mask;		/* OR of 1UL << enum ps3_notify_type */	} *notify_cmd;	struct {		u64 event_type;		/* enum ps3_notify_type */		u64 bus_id;		u64 dev_id;		u64 dev_type;		u64 dev_port;	} *notify_event;	pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,		 repo->dev_id, repo->dev_type);	buf = kzalloc(512, GFP_KERNEL);	if (!buf)		return -ENOMEM;	lpar = ps3_mm_phys_to_lpar(__pa(buf));	notify_cmd = buf;	notify_event = buf;	result = lv1_open_device(repo->bus_id, notification_dev_id, 0);	if (result) {		printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,		       __LINE__, ps3_result(result));		goto fail_free;	}	/* Setup and write the request for device notification. */	notify_cmd->operation_code = 0; /* must be zero */	notify_cmd->event_mask = 1UL << notify_region_probe;	result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,				   &tag);	if (result) {		printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,		       ps3_result(result));		goto fail_close;	}	/* Wait for the write completion */	result = ps3stor_wait_for_completion(notification_dev_id, tag,					     timeout);	if (result) {		printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,		       __LINE__, ps3_result(result));		goto fail_close;	}	/* Loop here processing the requested notification events. */	while (1) {		memset(notify_event, 0, sizeof(*notify_event));		result = lv1_storage_read(notification_dev_id, 0, 0, 1, 0,					  lpar, &tag);		if (result) {			printk(KERN_ERR "%s:%u: write failed %s\n", __func__,			       __LINE__, ps3_result(result));			break;		}		result = ps3stor_wait_for_completion(notification_dev_id, tag,						     timeout);		if (result) {			printk(KERN_ERR "%s:%u: read not completed %s\n",			       __func__, __LINE__, ps3_result(result));			break;		}		pr_debug("%s:%d: notify event (%u:%u:%u): event_type 0x%lx, "			 "port %lu\n", __func__, __LINE__, repo->bus_index,			 repo->dev_index, repo->dev_type,			 notify_event->event_type, notify_event->dev_port);		if (notify_event->event_type != notify_region_probe ||		    notify_event->bus_id != repo->bus_id) {			pr_debug("%s:%u: bad notify_event: event %lu, "				 "dev_id %lu, dev_type %lu\n",				 __func__, __LINE__, notify_event->event_type,				 notify_event->dev_id, notify_event->dev_type);			break;		}		if (notify_event->dev_id == repo->dev_id &&		    notify_event->dev_type == repo->dev_type) {			pr_debug("%s:%u: device ready (%u:%u:%u)\n", __func__,				 __LINE__, repo->bus_index, repo->dev_index,				 repo->dev_type);			error = 0;			break;		}		if (notify_event->dev_id == repo->dev_id &&		    notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) {			pr_debug("%s:%u: no access: dev_id %u\n", __func__,				 __LINE__, repo->dev_id);			break;		}	}fail_close:	lv1_close_device(repo->bus_id, notification_dev_id);fail_free:	kfree(buf);	pr_debug(" <- %s:%u\n", __func__, __LINE__);	return error;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品乱码免费| 亚洲人吸女人奶水| 久久精品国产秦先生| 91精品国产欧美一区二区18 | 欧美日韩午夜在线| 午夜精品久久久| 日韩午夜激情电影| 国产成人免费高清| 伊人开心综合网| 欧美日韩成人激情| 无码av免费一区二区三区试看| 欧美一区二区三区系列电影| 国产一区二区女| 中文字幕日韩一区二区| 欧美日韩亚洲不卡| 国产精品综合久久| 一级中文字幕一区二区| 精品国产一区二区三区不卡| www.亚洲人| 免费久久99精品国产| 欧美国产日产图区| 精品视频免费看| 国产一二精品视频| 亚洲电影视频在线| 91电影在线观看| 欧美视频你懂的| 久久99国产精品久久99果冻传媒| 亚洲国产精品v| 欧美日韩成人高清| 成人激情开心网| 免费的成人av| 亚洲免费视频成人| 久久亚洲综合色| 欧美三日本三级三级在线播放| 国产在线精品一区二区夜色| 亚洲国产成人av好男人在线观看| 久久综合色综合88| 欧美麻豆精品久久久久久| www.日本不卡| 国产剧情一区在线| 日韩影院精彩在线| 综合久久久久久| 久久久国产综合精品女国产盗摄| 欧美性猛交xxxx黑人交| 国产69精品久久99不卡| 麻豆91在线播放| 亚洲成人黄色小说| 亚洲欧美日韩人成在线播放| 久久久久久免费| 69精品人人人人| 欧美在线观看一区| 91在线码无精品| 国产成人夜色高潮福利影视| 蜜桃一区二区三区四区| 亚洲永久精品国产| 亚洲日本韩国一区| 国产欧美精品区一区二区三区| 日韩一区二区精品葵司在线 | 国产午夜精品一区二区| 成人短视频下载| 国产自产2019最新不卡| 日本欧美一区二区在线观看| 亚洲电影视频在线| 夜色激情一区二区| 一区二区三区精密机械公司| 亚洲欧美偷拍另类a∨色屁股| 国产精品天天看| 国产精品麻豆一区二区| 久久精品夜夜夜夜久久| 国产日产欧美一区二区视频| 国产亚洲va综合人人澡精品| 久久久久综合网| 国产亚洲精品久| 中文一区二区完整视频在线观看| 国产丝袜在线精品| 日本一区二区免费在线| 中文字幕av在线一区二区三区| 日本一区二区三区四区在线视频| 国产日韩v精品一区二区| 国产精品系列在线| 中文字幕一区二区不卡 | 欧美高清精品3d| 欧美乱熟臀69xxxxxx| 欧美精品亚洲一区二区在线播放| 国产亚洲欧美激情| 国产精品全国免费观看高清| 国产精品久久久一本精品| 自拍偷拍亚洲综合| 亚洲一二三区在线观看| 亚洲午夜精品网| 免费成人你懂的| 大胆亚洲人体视频| 色老综合老女人久久久| 欧美视频第二页| 日韩精品一区二区在线| 国产三级一区二区| 亚洲激情综合网| 蜜桃av一区二区三区| 国产精品69毛片高清亚洲| 成人av网站免费观看| 欧美视频日韩视频在线观看| 精品欧美乱码久久久久久1区2区| 国产亚洲一本大道中文在线| 亚洲精品ww久久久久久p站| 日本亚洲一区二区| 国产成人综合视频| 在线观看91精品国产入口| 欧美一区二区三区免费大片| 欧美国产一区在线| 亚洲电影第三页| 国产激情91久久精品导航| 色噜噜偷拍精品综合在线| 日韩一级二级三级精品视频| 国产精品久久久久天堂| 亚洲bdsm女犯bdsm网站| 国产美女精品一区二区三区| 91国偷自产一区二区三区成为亚洲经典| 欧美一级高清片| 国产精品超碰97尤物18| 免费人成黄页网站在线一区二区| 99精品视频一区| 精品嫩草影院久久| 亚洲国产视频网站| 国产91丝袜在线18| 欧美一级欧美三级| 亚洲精品欧美激情| 国产成人免费在线视频| 欧美福利视频导航| 亚洲精品免费电影| 国产盗摄一区二区三区| 制服丝袜在线91| 一区二区三区精品视频在线| 成人永久免费视频| 欧美大片顶级少妇| 亚洲成在人线免费| av激情综合网| 欧美激情一区二区三区蜜桃视频| 日韩精品一级二级| 一本色道久久综合狠狠躁的推荐| 国产视频在线观看一区二区三区| 热久久一区二区| 欧美精品三级在线观看| 一区二区三区.www| 色综合久久久久久久久久久| 日本一区二区高清| 国产精品一二三区在线| 精品国产免费一区二区三区香蕉| 石原莉奈一区二区三区在线观看| 欧美午夜在线观看| 亚洲精品久久久蜜桃| av电影一区二区| 国产精品欧美一区二区三区| 精品一区二区免费在线观看| 欧美一区二区精品| 喷白浆一区二区| 日韩一区二区三| 久久国产尿小便嘘嘘尿| 日韩欧美成人午夜| 美女网站色91| 精品毛片乱码1区2区3区| 天天色图综合网| 91精品国产免费| 麻豆精品在线播放| 欧美tickling网站挠脚心| 久久99国内精品| 精品国产一区a| 国产成人在线视频播放| 中文一区一区三区高中清不卡| 国产91露脸合集magnet| 中文字幕五月欧美| 一本一道久久a久久精品| 亚洲综合色自拍一区| 欧美精品xxxxbbbb| 日韩av一二三| 久久婷婷综合激情| 成人性生交大合| 亚洲欧美日韩国产综合在线 | 不卡在线视频中文字幕| 亚洲欧美一区二区视频| 91视频一区二区| 亚洲国产综合视频在线观看| 欧美美女网站色| 国产一区二区在线观看视频| 亚洲国产电影在线观看| 91视频com| 天堂久久一区二区三区| 久久综合色婷婷| 99国产欧美另类久久久精品| 樱花影视一区二区| 91精品国产欧美一区二区18| 极品少妇xxxx精品少妇偷拍| 久久久美女毛片| 色婷婷精品大在线视频 | 国产一区啦啦啦在线观看| 久久久久国产成人精品亚洲午夜| 99久久婷婷国产精品综合| 午夜精品久久久久久久99樱桃| 欧美电视剧在线看免费| 91免费视频观看| 日本不卡免费在线视频|